Creator

How CSS Gradients Work: Angles, Color Stops and Examples

Gradients add depth and personality to buttons, hero sections, and backgrounds, but hand-writing the CSS syntax is fiddly, especially with multiple color stops and angles. How linear and radial CSS gradients are built, what the angle really means, how colour stops are placed, and tips for gradients that look good.

Awais 2 min readPublished
How CSS Gradients Work: Angles, Color Stops and Examples

Gradients add depth and personality to buttons, hero sections, and backgrounds, but hand-writing the CSS syntax is fiddly, especially with multiple color stops and angles. The ToolOrbit CSS Gradient Generator lets you build linear and radial gradients visually with a live preview, then copy clean, ready-to-paste code.

How CSS gradients work

A CSS gradient is an image generated by the browser from color stops. A linear gradient blends colors along a straight line defined by an angle or direction, while a radial gradient blends outward from a center point. Each color stop has a color and an optional position, giving you precise control over where one color hands off to the next.

  • linear-gradient(): blends along an angle such as 90deg or to right
  • radial-gradient(): blends outward from a center in a circle or ellipse
  • Color stops: each color plus an optional percentage position
  • Multiple stops: add three or more colors for richer transitions
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}

.badge {
  background: radial-gradient(circle, #22d3ee 0%, #0ea5e9 100%);
}

Building a CSS gradient visually

Choose linear or radial, add and recolor your stops, and drag to reposition them while the live preview updates in real time. Set the angle for linear gradients or the shape for radial ones. When the result looks right, copy the generated CSS straight into your stylesheet.

  • Pick the gradient type: linear or radial
  • Add color stops and choose each color
  • Adjust positions and the angle or center
  • Copy the generated CSS with one click
For subtle, professional results, keep your colors close in hue or lightness. High-contrast gradients can look harsh, while gentle transitions read as polished.

Tips for great gradients

Use gradients to guide the eye, such as a darker corner that draws focus to a headline. Test your gradient behind real text to confirm contrast and readability. For large backgrounds, two-stop gradients usually look cleaner than busy multi-stop ones. The ToolOrbit Gradient Generator makes it easy to experiment quickly and ship the exact look you want.

What the angle really means

to/from angle directions
Keyword or angleDirection
to top (270deg)Bottom to top, like a sunrise
to right (90deg)Left to right
to top right (45deg)Diagonal, from bottom-left
0degTop to bottom

Adding a third stop in the middle of a two-color gradient, typically a tone in between, kills the muddy band — the single most common quick fix. Keep transitions going the same direction the light falls in your design, and sample against an image behind it before committing: gradients that look smooth on white can betray banding on a photo.


Tools mentioned

More reading

View all guides
HEX vs RGB vs HSL: Which Color Format to Use
Creator

HEX vs RGB vs HSL: Which Color Format to Use

HEX, RGB and HSL describe the same colours in three ways. Here is how each one works and when each is the easier choice in CSS and design tools.

2 min readPublished
CSS box-shadow Explained: Offset, Blur, Spread and Inset
Creator

CSS box-shadow Explained: Offset, Blur, Spread and Inset

How the CSS box-shadow property works, value by value, with tips for layered, realistic shadows.

2 min readPublished
CSS border-radius Explained: One, Two and Four Values
Creator

CSS border-radius Explained: One, Two and Four Values

How the CSS border-radius property works and how its one-, two- and four-value shorthand maps to each corner.

2 min readPublished
CSS Border Radius: 15 Copy-Paste Examples
Developer

CSS Border Radius: 15 Copy-Paste Examples

15 modern CSS border radius examples: rounded cards, pills, circle avatars, asymmetrical organic blobs, and fancy 8-value border radius shapes.

3 min readPublished
GEO, AEO and AIO Explained: How to Get Cited in AI Search
SEO

GEO, AEO and AIO Explained: How to Get Cited in AI Search

Understand GEO, AEO, and AIO search optimization. Learn how AI engines discover, extract, and cite your content with our practical checklists and free tools.

5 min readPublished
Watermarking a PDF: text stamps explained
PDF

Watermarking a PDF: text stamps explained

When a CONFIDENTIAL or DRAFT stamp is worth adding, how to size and place it, and what a watermark can and cannot protect.

3 min readPublished
Page numbers in a PDF: placement, format and start values
PDF

Page numbers in a PDF: placement, format and start values

How to number a PDF cleanly for reports, theses and filing — where to put the numbers, which format to pick, and how to start from any value.

2 min readPublished
How to create a reusable digital signature image
Business

How to create a reusable digital signature image

The difference between a signature image, an electronic signature and a legally binding one — and how to draw a clean PNG you can reuse.

2 min readPublished