← Home Blog
Development

CSS Gradient Generator Guide: Linear, Radial and Conic

Updated: August 2026 • 6 min read
CSS Gradient Guide

A CSS gradient is a smooth blend between two or more colors that the browser paints directly, with no image file required. Because the browser renders it in real time, a gradient stays razor sharp at any size, adds nothing to your page weight, and can be changed by editing a single line of code. A gradient generator lets you pick the colors visually and copy the finished CSS.

The three types of gradient

CSS offers three gradient functions, and each spreads color in a different shape.

Syntax and examples

Each gradient is assigned to the background property. Here is one of each type:

/* Linear: 135-degree diagonal blend */ background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); /* Radial: glow from the center */ background: radial-gradient(circle at center, #0ea5e9 0%, #1e293b 100%); /* Conic: sweep around a point */ background: conic-gradient(from 0deg, #f59e0b, #ef4444, #6366f1, #f59e0b);

Direction, angle, and color stops

Three settings give you full control over how the colors flow.

How to use the CSS gradient generator online

  1. Choose your first and second colors, and add more stops if you want.
  2. Pick the gradient type and set the angle or direction.
  3. Drag the stops to fine-tune where each color sits.
  4. Copy the generated CSS and paste it into your stylesheet’s background property.

Common use cases

Tips for better gradients

FAQ

Q: How do I make a diagonal gradient?
A: Use an angle such as 135deg in a linear-gradient, for example background: linear-gradient(135deg, #4f46e5, #7c3aed);. The angle controls the diagonal direction.

Q: What is a color stop?
A: A color stop is a color plus an optional position that tells the browser where that color should appear along the gradient, such as #7c3aed 100%. Adjusting stops changes how quickly one color fades into the next.

Q: Can I animate CSS gradients?
A: Browsers cannot smoothly transition the gradient itself, but you can create motion by animating the background-position, background-size, or the element’s rotation to give the appearance of a moving gradient.

Use the CSS Gradient Generator