CSS Gradient Generator

Build a linear, radial or conic gradient visually: add, move and recolor stops, set the angle or position, and copy ready-to-paste CSS.

Loading tool…

About the CSS Gradient Generator

CSS has three gradient functions. linear-gradient(135deg, …) blends along a line whose angle is measured clockwise from “to top”. radial-gradient(circle at center, …) spreads from a point, and conic-gradient(from 0deg at center, …) sweeps around one, which is how pie charts and color wheels are drawn in pure CSS. Each has a repeating- variant that tiles the stop pattern.

Stops are written as color position. Two stops at the same position create a hard edge, which is how stripes are made without images. Stops accept any CSS color, including rgba() for fades to transparent. When a later stop has a smaller position than an earlier one, the browser clamps it to the earlier position.

Gradients are images, so they go in background or background-image, not background-color. The generated CSS includes a solid fallback line for very old browsers. All current browsers support these functions without vendor prefixes. Presets give quick starting points, including a conic color wheel and hard-stop stripes.

How to use it

  1. Choose Linear, Radial or Conic.
  2. Set the angle, or the shape and position for radial and conic gradients.
  3. Edit color stops: change colors, drag positions, add, reorder or remove stops.
  4. Start from a preset if you like, then copy the CSS.

Frequently asked questions

How do I make a gradient with a hard line?
Place two stops at the same position, for example linear-gradient(90deg, red 50%, blue 50%). Use repeating-linear-gradient to turn that into stripes.
Do CSS gradients need -webkit- prefixes?
No. Unprefixed linear, radial and conic gradients work in all current browsers. Prefixes only mattered for browsers from before 2013.
How do I fade to transparent?
Use a transparent version of the same color as the last stop, such as rgba(52, 211, 153, 0), instead of the keyword transparent, which older engines interpolated through gray.
Can I animate a gradient?
Gradient images cannot be transitioned directly. Animate background-position on an oversized gradient, or register custom properties with @property and animate those.

Related tools