CSS Gradient Generator

Create CSS gradients with live preview — linear, radial, dark, and black gradients. Copy the CSS code instantly. Free, no signup needed.

Gradient Generator

Create beautiful CSS gradients

90°180°270°360°
background: linear-gradient(135deg, #667eea, #764ba2);
Modern Design: CSS gradients create smooth color transitions perfect for backgrounds, buttons, and design elements. Copy the generated CSS and paste it directly into your stylesheet.

What is a CSS Gradient?

A CSS gradient is a smooth transition between two or more colors applied directly as a CSS background — no image file required. The browser generates the gradient at render time, which means it scales perfectly to any screen size, loads instantly (zero HTTP request), and can be changed entirely in code.

CSS introduced the linear-gradient() and radial-gradient() functions as part of the CSS Images specification. They are now supported in every modern browser including Chrome, Firefox, Safari, and Edge with no prefix required. A third type, conic-gradient(), is supported in all modern browsers and is useful for pie charts and angle-based designs.

Gradients replaced image-based backgrounds in most modern web design workflows. Where a designer once exported a 50KB JPG just to achieve a subtle background fade, a CSS gradient achieves the same result in under 100 bytes of code — and it adapts to dark mode, retina screens, and any container size automatically.

Browser Support

Gradient typeChromeFirefoxSafariEdge
linear-gradient()✅ Yes✅ Yes✅ Yes✅ Yes
radial-gradient()✅ Yes✅ Yes✅ Yes✅ Yes
conic-gradient()✅ Yes✅ Yes✅ Yes✅ Yes
background-clip: text✅ Yes✅ Yes✅ Yes✅ Yes

How to Create CSS Gradients Online

1. Choose gradient type

Pick linear, radial, or conic gradient. Linear gradients flow in a straight line, radial gradients radiate from a center point, and conic gradients sweep around a point.

2. Pick your colors

Add color stops and adjust their positions. You can create dark gradient CSS, black gradients, vibrant multi-color gradients, or anything in between using the color picker.

3. Copy the CSS code

The CSS gradient code is generated in real time. Copy it and paste it directly into your stylesheet as a background property — it works on any HTML element.

CSS Gradient Types

Linear Gradient
Transitions colors in a straight line. Control direction with "to right", "to bottom", or any angle like 45deg.
background: linear-gradient(to right, #ff0000, #0000ff);
Radial Gradient
Colors radiate outward from a center point. Great for glowing effects and spotlight-style backgrounds.
background: radial-gradient(circle, #ff0000, #0000ff);
Dark / Black Gradient
Dark gradient CSS is popular for hero sections, cards, and overlays. Combine deep blacks with dark blues or purples.
background: linear-gradient(135deg, #1a1a2e, #16213e);

CSS Linear Gradient Syntax

/* Basic syntax */
background: linear-gradient(direction, color-stop1, color-stop2, ...);
/* Examples */
background: linear-gradient(to right, #ff6b6b, #4ecdc4);
background: linear-gradient(45deg, #000000, #434343);
background: linear-gradient(to bottom, #1a1a2e, #16213e, #0f3460);

Popular Gradient Use Cases

Hero Backgrounds
Full-page CSS gradient backgrounds for landing pages — dark gradients with deep blues and purples are especially popular.
Button Gradients
Apply gradient CSS to buttons for a modern look: background: linear-gradient(to right, #f093fb, #f5576c).
Text Gradients
Use background-clip: text with a CSS gradient to create colorful gradient text effects.
Overlays
Dark gradient CSS overlays on images (background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.8))) for text legibility.
Card Backgrounds
Subtle light gradients on card components add depth without heavy visual noise.
CSS Black Gradient
Deep black gradients (linear-gradient(135deg, #0c0c0c, #1a1a1a)) are widely used for dark-mode UI design.

Popular CSS Gradient Combinations

Copy any of these ready-to-use CSS gradients directly into your stylesheet.

Sunset
linear-gradient(135deg, #f093fb, #f5576c)
Ocean
linear-gradient(135deg, #667eea, #764ba2)
Dark Blue
linear-gradient(135deg, #0c0c1e, #1a1a4e)
Purple to Pink
linear-gradient(to right, #7928ca, #ff0080)
Forest
linear-gradient(135deg, #134e5e, #71b280)
Charcoal
linear-gradient(135deg, #232526, #414345)
Golden Hour
linear-gradient(135deg, #f7971e, #ffd200)
Midnight
linear-gradient(135deg, #000000, #0f2027, #203a43)

How to Make a CSS Text Gradient

A CSS text gradient applies a gradient fill to text rather than a background. This is done using background-clip: text combined with -webkit-text-fill-color: transparent. It works in all modern browsers.

/* CSS text gradient */
.gradient-text {
background: linear-gradient(to right, #f093fb, #f5576c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

Use the generator above to create your gradient, copy the CSS value, and replace the background value in this snippet. Text gradients work best on large headings where the color transition is clearly visible.

FAQ

CSS Gradient Generator