CSS Gradient Generator

Build a gradient with your own colors, adjust its color stops, and copy the CSS for your website.

Linear Gradient · 2 stops
Gradient Settings
90°
Color Stops
2 / 10
%
%
Generated CSS
/* CSS */
background: linear-gradient(90deg, #6366F1 0%, #EC4899 100%);
Quick Copy

How to create a CSS gradient

  1. Choose a gradient type: Linear, Radial, or Conic.
  2. Select the colors by clicking each color swatch.
  3. Adjust the color-stop positions for each color.
  4. Adjust the direction or angle where the type supports it (linear and conic).
  5. Preview the result and copy the CSS from the output panel.

Linear, radial, or conic?

Linear

Transitions along a straight direction set by the angle.

Radial

Transitions outward from a center point across a circle.

Conic

Transitions around a center point, sweeping from a starting angle.

CSS gradient examples

Labeled reference examples. They are static previews, not loaded from the editor.

Linear
background-image: linear-gradient(90deg, #6366F1 0%, #EC4899 100%);
Radial
background-image: radial-gradient(circle, #0EA5E9 0%, #1E293B 100%);
Conic
background-image: conic-gradient(from 0deg, #6366F1 0%, #EC4899 50%, #6366F1 100%);

Use the gradient in your CSS

Apply the selector to the intended element. The background-color line is a solid fallback shown while the gradient loads or in browsers that do not render it.

.gradient-background {
  background-color: #6366F1;
  background-image: linear-gradient(90deg, #6366F1 0%, #EC4899 100%);
}

Copying the complete declaration includes the property name. Copying only the gradient value (for example linear-gradient(...)) lets you place it inside any existing background-image rule.

Frequently asked questions

What is a CSS gradient?
A CSS gradient is a transition between colors generated by the browser using a CSS function such as linear-gradient, radial-gradient, or conic-gradient. It does not require a separate background image file.
What do color-stop percentages mean?
The percentage on a color stop sets where that color is positioned within the gradient. 0% is the start of the gradient axis and 100% is the end, so a stop at 50% places that color halfway along the transition.
How do CSS linear-gradient angles work?
The angle rotates the gradient direction. 0deg points upward, 90deg points to the right, 180deg points downward, and 270deg points to the left. The preset angle buttons set common values quickly.
Can I use more than two colors?
Yes. The editor supports up to 10 color stops. Add stops with the add control and drag or type each stop's position to place it within the gradient.
Can I place text over a gradient?
You can, but contrast can vary across the background because the colors change from one stop to the next. Check the text and background combination with the Contrast Checker at the positions where text actually appears.

Related Tools