A radial gradient blends colors outward from a center point in a circle or ellipse, and a conic gradient sweeps colors around a center point like the hands of a clock. You create them with radial-gradient() and conic-gradient(), both used as background-image values. This guide explains css radial gradient and conic gradient syntax, with practical patterns.
Both work like linear-gradient() in how color stops behave; the difference is the geometry that the stops follow.
The syntax is radial-gradient(shape size at position, stops...). Everything before the stops is optional.
The first color sits at the center and the last at the edge of the gradient shape. The default shape is ellipse, which stretches to match the box proportions, and the default center is the middle of the element.
| Part | Values | Effect |
|---|---|---|
| Shape | circle, ellipse | Round or box-proportioned |
| Size | closest-side, farthest-side, closest-corner, farthest-corner, or explicit lengths | Where the last color stop lands |
| Position | at center, at 20% 30%, at right bottom | Where the center is |
The default size is farthest-corner, so the gradient ends exactly at the corner farthest from the center. Use closest-side when you want a spot that stays inside the box.
This draws a soft white spotlight on a dark box. Fading to the same hue with zero alpha avoids a gray fringe.
A conic gradient places color stops by angle around a center, starting at the top and moving clockwise.
Repeating the first color at the end closes the circle without a visible seam. You can set the start angle and center with from and at.
Stop positions can be angles (90deg) or percentages of the full turn (25%).
Two stops at the same position make a sharp boundary. That is the basis of a pure CSS pie chart.
The segments cover 45, 30 and 25 percent. This is decorative only: a chart that conveys data must also provide the numbers as text or a table so assistive technology can read them.
repeating-radial-gradient() and repeating-conic-gradient() tile the stop list.
The first draws concentric rings. The second makes a checkerboard from a repeated quarter-turn pattern, resized into 40 pixel tiles with background-size.
| Type | Stops follow | Typical use |
|---|---|---|
linear-gradient() | A straight line | Banners, buttons, overlays |
radial-gradient() | Distance from a center | Spotlights, glows, vignettes |
conic-gradient() | Angle around a center | Pie charts, color wheels, checkers |
All three functions are supported in current evergreen browsers. For a safe baseline, put a solid background-color first, then the gradient. Interpolation color spaces (for example in oklch) are a newer addition that you can add on top, keeping a plain version as the earlier declaration.
A radial gradient changes color with distance from the center, so its bands are circles or ellipses. A conic gradient changes color with angle around the center, so its bands are wedges.
Write circle first: radial-gradient(circle, ...). Otherwise the shape stretches with the element box.
For radial and conic gradients use at x y, for example at 25% 75%. For conic gradients, add from 45deg to rotate the start angle.
Yes, with hard-stop conic-gradient() and border-radius: 50%, but add real data in text for accessibility.
Radial gradients radiate from a point and are described by shape, size and position. Conic gradients rotate around a point and are described by angle. Both accept hard stops and repeating forms, which unlock rings, pies and checkerboards without images. Keep a solid color fallback and give charts a text equivalent.