CSS Gradient Generator

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.

100% FreeNo Sign-upLinear & RadialLive Preview
Gradient Type
Color 1
Color 2
Direction / Angle↘ Bottom-Right135°
Generated CSS
/* CSS */
.element {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  background: -webkit-linear-gradient(135deg, #7c3aed, #2563eb);
}
Preview

Left: current · Right: reversed

What is a CSS Gradient?

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.

Linear vs. Radial Gradients

Linear Gradients

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.

background: linear-gradient(135deg, #7c3aed, #2563eb);

Radial Gradients

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.

background: radial-gradient(circle, #7c3aed, #2563eb);

When to Use Each

  • Linear gradients work best for backgrounds, banners, button fills, and dividers.
  • Radial gradients are ideal for spotlight/glow effects, circular avatars, and card highlights.
  • Combine both with CSS layer syntax (background: grad1, grad2) to create complex multi-layer compositions.

Browser Compatibility

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.

Browserlinear-gradientradial-gradientNotes
Chrome26+26+Full support, no prefix needed
Firefox16+16+Full support, no prefix needed
Safari6.1+6.1+-webkit- prefix for <6.1
Edge12+12+Full support
Opera12.1+12.1+Full support
iOS Safari7+7+-webkit- prefix for older versions