CSS Gradient Generator

Adjust CSS gradients and generate code

Settings

Gradient Type
Color Stops 4 / 8
%
%
%
%

Preview

background: linear-gradient(135deg, #ff6b6b 0%, #feca57 33%, #48dbfb 66%, #1dd1a1 100%);

What is CSS Gradient Generator?

CSS Gradient Generator is a tool for creating linear-gradient and radial-gradient backgrounds, previewing them live, and copying the resulting CSS. As you change colors, angles, shapes, and stop positions, the background code updates immediately.

It is useful for hero sections, card backgrounds, banners, buttons, and other UI areas that need a gradient instead of a flat color.

How to Use

  1. Choose either a linear or radial gradient.
  2. Add, remove, and reposition color stops.
  3. Set the angle for linear gradients or the shape for radial gradients.
  4. Check the live preview.
  5. Copy the generated background: ...; code.

You can add up to 8 color stops, and the Equal Position control helps spread them evenly before fine-tuning.

Main Settings

Gradient Type

Switch between linear and radial gradients. Linear gradients use an angle, while radial gradients use a shape such as circle or ellipse.

Angle

This setting appears for linear gradients. It supports values from 0 to 360 degrees, and common angles can be selected quickly from preset buttons.

Color Stops

Each stop can be placed between 0% and 100%. This lets you control where one color starts blending into the next.

Input and Output Example

For example, if you use a linear gradient with 135deg and four color stops, the output can look like this:

background: linear-gradient(135deg, #ff6b6b 0%, #feca57 33%, #48dbfb 66%, #1dd1a1 100%);

If you switch to a radial gradient, the output becomes a format like this:

background: radial-gradient(circle, #ff6b6b 0%, #feca57 33%, #48dbfb 66%, #1dd1a1 100%);

Linear vs. Radial

Linear Gradient

Use this when you want the color flow to follow a direction. It works well for hero areas, banners, buttons, and other wide background surfaces.

Radial Gradient

Use this when you want color to spread from a center point. It is a good fit for spotlight-like accents or softer focal backgrounds.

Use Cases

  • Creating gradient backgrounds for web pages
  • Replacing flat button or card backgrounds with something richer
  • Trying different banner or hero treatments
  • Adjusting stop positions while checking the generated CSS at the same time

Things to Keep in Mind

  • Too many colors can make a background feel visually busy
  • If text sits on top of the gradient, readability should be checked separately
  • The tool generates background code, so background size or positioning rules may still need to be added in your project