DevToolHere

How to Build CSS Gradients

CSS gradients add depth and visual interest to your designs without image files. Whether you need a subtle background fade or a vibrant hero section, the gradient generator lets you design visually and export clean CSS code.

Try CSS Gradient Generator Now

Free, no signup. Works in your browser.

Open Tool
1

Choose the gradient type

Select from linear (straight line), radial (circular), or conic (angular sweep) gradient types. Linear is the most common choice for backgrounds and cards.

2

Add and position color stops

Click on the gradient bar to add color stops. Drag them to adjust their position, and click each stop to change its color using the color picker. You need at least two stops for a gradient.

3

Adjust the angle or center point

For linear gradients, drag the angle dial or type a specific degree value. For radial gradients, set the center position and shape (circle or ellipse). The preview updates in real time.

4

Fine-tune with advanced options

Enable repeating gradients for stripe patterns, adjust color interpolation (sRGB vs. oklch for smoother transitions), and layer multiple gradients for complex effects.

5

Copy the CSS code

The tool generates the CSS `background` property with vendor prefixes for broad compatibility. Copy the code and paste it directly into your stylesheet.

Pro Tips

  • *Use oklch color space for smoother gradients — `background: linear-gradient(in oklch, #f00, #00f)` avoids the muddy middle zone.
  • *Subtle gradients (e.g., white to very light gray) often look more professional than bold multi-color gradients.
  • *Layer a semi-transparent gradient over an image for a polished hero section overlay effect.
  • *Use conic gradients to create pie chart visuals or color wheel effects purely in CSS.

Related Guides

Explore all 110+ tools