Course contentsShow
← Web Development
Lesson 190 of 2,9823. CSS FundamentalsFree lesson

Gradients: Radial and Conic

Build radial-gradient() patterns from a center point and conic-gradient() for circular color wheels.

Gradients: Radial and Conic

You'll learn how to create circular and angular gradient patterns that radiate from a center point or sweep around like a color wheel.

What Are Radial and Conic Gradients?

While linear gradients flow in a straight line, radial gradients spread outward from a center point like ripples in a pond or rays of sunlight. Conic gradients rotate around a center point like a pie chart or rainbow wheel, changing colors as they sweep in a circle.

Radial Gradients

The radial-gradient() function creates a circular or elliptical color transition:

.radial-example {
  background: radial-gradient(circle, yellow, orange, red);
}

Think of it like dropping a stone in water—the colors spread from the center outward. You can specify circle or ellipse as the shape, and position the center:

.positioned-radial {
  background: radial-gradient(circle at top left, blue, transparent);
}

Conic Gradients

The conic-gradient() function rotates colors around a center point in a circular sweep:

.conic-example {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
}

Imagine a spinning color wheel or a clock face where colors change as you move clockwise. This is perfect for pie charts, loading spinners, or rainbow effects.

.color-wheel {
  background: conic-gradient(from 0deg, hsl(0, 100%, 50%), hsl(360, 100%, 50%));
  border-radius: 50%;
}

Combining What You Know

You can use positioning keywords, multiple color stops, and even transparency (rgba/hsla) to create sophisticated effects.

Key Takeaway: Use radial-gradient() for center-outward color spreads and conic-gradient() for circular, rotating color patterns—both add dimensional depth beyond linear gradients.