/* CSS */
.element {
background: linear-gradient(135deg, #7c3aed, #2563eb);
background: -webkit-linear-gradient(135deg, #7c3aed, #2563eb);
}Left: current · Right: reversed
Create beautiful CSS linear and radial gradients with a live preview. Pick your colors, set the direction, copy the code — no sign-up, 100% free.
/* CSS */
.element {
background: linear-gradient(135deg, #7c3aed, #2563eb);
background: -webkit-linear-gradient(135deg, #7c3aed, #2563eb);
}Left: current · Right: reversed
A CSS gradient is a smooth transition between two or more colors rendered entirely by the browser — no image file needed. Gradients are defined using CSS functions like linear-gradient() and radial-gradient(), and they can be applied to any CSS property that accepts an image — most commonly background and background-image.
Because gradients are vector-based and resolution-independent, they scale perfectly on all screen sizes — from standard monitors to ultra-high-DPI Retina displays — without any pixelation or blurriness. They also load instantly, reducing HTTP requests and improving Core Web Vitals scores compared to raster gradient images.
A linear gradient transitions colors along a straight line. You control the direction using an angle in degrees (0deg = bottom to top, 90deg = left to right) or a keyword like to right, to bottom right.
A radial gradient radiates colors outward from a central point in an elliptical or circular shape. Use circle for a perfect round gradient or ellipse (the default) for an oval-shaped one.
Both linear-gradient and radial-gradient have been fully supported since 2013 across all modern browsers. Our generator also outputs a -webkit- prefixed fallback for maximum legacy compatibility.
| Browser | linear-gradient | radial-gradient | Notes |
|---|---|---|---|
| Chrome | 26+ | 26+ | Full support, no prefix needed |
| Firefox | 16+ | 16+ | Full support, no prefix needed |
| Safari | 6.1+ | 6.1+ | -webkit- prefix for <6.1 |
| Edge | 12+ | 12+ | Full support |
| Opera | 12.1+ | 12.1+ | Full support |
| iOS Safari | 7+ | 7+ | -webkit- prefix for older versions |