CSS Gradient Generator

Design a linear, radial or conic gradient visually and copy the CSS code.

How to use the CSS Gradient Generator

  1. Choose linear, radial or conic.
  2. Set the colors and drag the sliders to position each color stop. Add up to six colors.
  3. Adjust the angle and copy the CSS code into your stylesheet.

CSS gradient types

  • Linear: colors change along a straight line. The angle sets the direction: 0deg runs bottom to top, 90deg left to right and 180deg top to bottom.
  • Radial: colors spread outward from a center point in a circle or ellipse.
  • Conic: colors rotate around a center point, like a color wheel or pie chart.

Syntax

background: linear-gradient(90deg, #1463ff 0%, #7c3aed 100%);

Each color stop has a color and a position. Two stops at the same position create a hard edge instead of a blend, which is useful for stripes.

Tips

  • Gradients between neighbouring hues look smooth; gradients between opposite hues can turn grey in the middle. Add a third color stop to keep them vivid.
  • Gradients are drawn by the browser, so they stay sharp at any size and add almost nothing to page weight.
  • All current browsers support linear, radial and conic gradients without prefixes.

Frequently asked questions

How do I make a gradient in CSS?

Use the background property with linear-gradient(), radial-gradient() or conic-gradient() and list the colors, for example background: linear-gradient(90deg, #1463ff, #7c3aed).

What does the angle mean?

It is the direction of the gradient line. 90deg goes from left to right and 180deg from top to bottom.

Do gradients slow down a website?

No. They are generated by the browser from a line of CSS and are much lighter than image backgrounds.