Create CSS gradients visually
Gradients add depth and color to buttons, hero sections, cards and backgrounds without a single image file. Writing them by hand, though, means guessing angles and percentages and reloading the page again and again. This CSS gradient generator lets you design the gradient visually with a live preview and gives you clean, copy-ready CSS that works in every modern browser.
Features
- Three gradient types: linear, radial (circle or ellipse) and conic.
- Up to eight color stops with draggable positions.
- Angle slider for linear and conic gradients.
- Presets and a random button for quick inspiration.
- Solid fallback color included in the CSS.
- Copy the code in one click.
Using the CSS
Paste the code into the rule for the element you want to style:
.hero {
background: #0ea5e9;
background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
}
Gradients are images in CSS, so you can also use them in background-image, layer several gradients separated by commas, or combine them with a photo: background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)), url(photo.jpg); darkens a picture so white text on top stays readable.
Design tips
- Keep it subtle. Two neighboring hues (blue to purple, orange to pink) look smoother and more modern than opposite colors.
- Check contrast. If text sits on the gradient, make sure it's readable over both ends — test colors with the Color Converter, which shows contrast ratios.
- Pull colors from a brand image with the Image Color Picker.
- Add depth to cards and buttons with the Box Shadow Generator.