How to Make a CSS Gradient: Linear, Radial and Conic
Updated November 2026
Written by the Toolpuffin team. Tools in this guide are tested in the browser.
A CSS gradient is a smooth change between colours, made by the browser without an image. This guide explains the three types and how to build one visually.
Try the tool: CSS Gradient Generator
The three types
| Type | How it changes | CSS |
|---|---|---|
| Linear | Along a line | linear-gradient(90deg, #0b6b5c, #ffd166) |
| Radial | Outwards from a centre point | radial-gradient(circle, #0b6b5c, #ffd166) |
| Conic | Around a centre point, like pie slices | conic-gradient(#0b6b5c, #ffd166, #0b6b5c) |
Source: MDN: CSS gradients
Angles and colour stops
- The angle of a linear gradient sets the direction: 90deg goes left to right, 180deg top to bottom.
- Each colour can get a position, such as 40%, which sets where it is at full strength.
- Several colours with their own positions make hard bands or a softer fade.
Build one
- Choose the type and the angle.
- Pick the colours and move their positions.
- Copy the CSS.
The fallback line
The tool puts a plain colour on the first line, for very old browsers that do not understand gradients. Modern browsers use the gradient on the second line.
Text and borders
A gradient also works on text and borders, but that needs extra CSS, such as background-clip for text. The tool only makes the gradient itself.
Keep text readable
Check the contrast of text that sits on a gradient at its lightest and its darkest point, not only in the middle.