How to use the CSS Gradient Generator
- 1Start from a preset or keep the default colors.
- 2Choose Linear, Radial or Conic.
- 3Set the angle, then edit each color stop's color and position.
- 4Add up to eight stops, or press Random colors for ideas.
- 5Copy the CSS and paste it into your stylesheet.
The three gradient types
- Linear gradients blend colors along a straight line. The angle sets the direction: 0° goes bottom to top, 90° left to right.
- Radial gradients spread out from the center as a circle or ellipse, good for glows and spotlights.
- Conic gradients sweep colors around a center point, like a color wheel or pie chart.
Color stops
Each stop is a color and a position from 0% to 100%. Stops close together create sharp transitions; stops far apart blend softly. Two stops at the same position make a hard edge, which is useful for stripes.
The CSS
The output sets a solid background-color first, as a fallback, then the background-image gradient. Gradients are drawn by the browser, so they stay sharp at any size and add nothing to page weight.
Tips
- Gradients between two very different hues can look muddy in the middle. Add a third stop in between to keep them vivid.
- Keep text readable: check text over the lightest and darkest parts of the gradient with the Contrast Checker.
Reading the CSS it gives you
A typical result looks like this:
background: linear-gradient(135deg, #0f766e 0%, #38bdf8 100%);
The first value is the angle. 0deg points up, 90deg points right, 180deg points down and 135deg runs from the top-left corner to the bottom-right. Each color after it takes a stop position, and the browser blends the space between stops.
Gradient over a photo
Backgrounds stack, and the first one listed sits on top. For a dark overlay on an image, write background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url(photo.jpg);. Text on top should then be tested against the worst spot in the gradient, not its average, using the WCAG contrast checker.
Common mistakes
- Colors that are too close in lightness produce visible banding. Move the two ends further apart, or add a middle stop.
- Gradients between very different hues often pass through a muddy middle. Add a stop with a color in between.
- Forgetting the fallback. Put a plain background-color line first so older browsers still show something.
If you need a coherent set of colors to build from, start in the color palette generator. To get the HEX or RGB value of a stop, use the HEX to RGB converter.
Frequently asked questions
Do CSS gradients work in all browsers?
Yes. Linear, radial and conic gradients are supported by all modern browsers without prefixes.
How do I make a hard color edge?
Put two stops at the same position, for example red at 50% and blue at 50%.
Can I use a gradient on text?
Yes. Apply the gradient as a background, then add background-clip: text and color: transparent to the text element.
How do I reverse a gradient?
Swap the order of the color stops, or add 180 degrees to a linear angle. For a 45deg gradient the reverse is 225deg.
What is the difference between linear, radial and conic gradients?
A linear gradient blends along a straight line, a radial one spreads outward from a center point, and a conic one sweeps around a center like a color wheel.
How many color stops can I use?
This generator supports up to eight stops. CSS itself allows more, but most designs read better with two to four.
Last updated · By the DailyDeskTools team
Built and written with AI assistance, then tested by hand by our team. How we make our tools