Free No sign-up · Runs in your browser

CSS Gradient Generator

Build linear, radial and conic gradients by dragging color stops. Copy ready-to-use CSS or Tailwind code, or download the gradient as an image.

Color stops

Gradient presets

Click a preset to load it into the editor.

How to make a CSS gradient

  1. Pick a type. Linear gradients go in a straight line, radial gradients spread out from the center, and conic gradients sweep around a point like a color wheel.
  2. Set the colors. Click a stop's swatch to change its color, drag the handles on the bar to move it, or click the bar to add a new stop.
  3. Adjust the angle for linear and conic gradients with the slider or the arrow buttons.
  4. Copy the code. The CSS includes a solid fallback color for very old browsers. The Tailwind version uses an arbitrary value, so it works without changing your config.

CSS gradient syntax

A linear gradient takes a direction followed by color stops: linear-gradient(90deg, #ff5f6d 0%, #ffc371 100%). The angle is measured clockwise from the top, so 0deg goes upward and 90deg goes to the right. Each stop is a color with an optional position. A radial gradient replaces the angle with a shape, e.g. radial-gradient(circle, …), and a conic gradient uses conic-gradient(from 90deg, …).

Tips for better gradients

  • Colors that sit close together on the color wheel blend smoothly. Opposite colors can look muddy gray in the middle, so add a third stop to steer the transition.
  • Use the Palette from Image tool to build a gradient from a photo's colors.
  • Check text contrast on both ends of the gradient with the color converter.

Frequently asked questions

Do CSS gradients work in all browsers?

Linear and radial gradients work in every modern browser. Conic gradients work in all current versions of Chrome, Edge, Firefox and Safari.

How do I use a gradient as a text color?

Set the gradient as the background, then add -webkit-background-clip: text; background-clip: text; color: transparent; to the text element.

Can I animate a gradient?

A common trick is to make the background larger than the element (for example background-size: 200% 200%) and animate background-position with keyframes.

Guides