DevKits

CSS Gradient Generator (Linear & Radial)

Design linear and radial CSS gradients with a visual color-stop editor. Copy production-ready CSS or Tailwind classes.

Last updated:

0%
100%
CSS
background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
CSS value only
linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%)
Tailwind (approx.)
bg-gradient-to-br from-[#3b82f6] to-[#8b5cf6]

Add color stops and choose linear or radial above to design a CSS gradient with a live preview. Copy production-ready CSS or Tailwind classes. Everything runs in your browser.

What is CSS Gradient?

A CSS gradient generator lets you visually design linear and radial gradients and copy the exact CSS. Gradients are pure CSS — no image files — so they're crisp at any resolution, tiny in size, and easy to animate. This tool gives you a live preview while you add color stops, set the angle or shape, and then exports either raw CSS or Tailwind utility classes.

How to create a CSS gradient

  1. 1Choose linear or radial gradient type.
  2. 2Add color stops and drag them to position; set the angle for linear gradients.
  3. 3Watch the live preview update as you tweak stops and direction.
  4. 4Copy the generated CSS (or Tailwind classes) into your stylesheet.

Use Cases

Design hero backgrounds

Create an eye-catching linear gradient background for a landing page hero without any image asset.

Style buttons and cards

Add depth to buttons and cards with subtle gradients that scale crisply on any display.

Export Tailwind classes

Grab bg-gradient-to-r from-*/via-*/to-* utilities to drop straight into a Tailwind project.

Code Examples

Linear gradient

background: linear-gradient(90deg, #3B82F6 0%, #8B5CF6 100%);

Radial gradient

background: radial-gradient(circle at center, #F59E0B 0%, #EF4444 100%);

Key Concepts

Color stops
Each stop is a color plus an optional position (%). Two stops make a simple fade; more stops create bands and multi-color transitions.
Linear vs radial
Linear transitions along a line defined by an angle (90deg = left-to-right). Radial emanates outward from a center point as circles or ellipses.
Angle direction
In CSS, 0deg points up and angles increase clockwise, so 90deg goes to the right. Keyword forms like 'to right' are equivalent.

Tips & Best Practices

  • Modern browsers need no vendor prefixes for standard gradients — the -webkit- prefixes are legacy.
  • Add a matching solid background-color fallback for very old browsers.
  • Subtle gradients (close hues, low contrast) look more professional than harsh rainbow transitions.
  • For arbitrary angles or 3+ stops, use the raw CSS output — Tailwind utilities cover only common cases.

Frequently Asked Questions

What's the difference between linear and radial gradients?

Linear gradients transition along a straight line, defined by an angle or 'to right/top-left' keywords. Radial gradients emanate from a center point outward in circles or ellipses, defined by shape and size.

Can I use these gradients as CSS backgrounds?

Yes. The output is a complete CSS value ready to paste into a background or background-image property. It works in all modern browsers without prefixes.

Does the Tailwind output work with any Tailwind version?

The output uses Tailwind 3 gradient utility classes (bg-gradient-to-r, from-, via-, to-). For arbitrary angles or three-plus stops, use the raw CSS output which works everywhere.

Related Tools