How to Make a CSS Gradient: Linear, Radial, Conic
Last updated: · 2 min read
A gradient gives a colour transition without an image. The tool lets you edit linear, radial and conic gradients visually; the CSS updates as you change the angle, colours and stops. This guide explains the formula, works through an example and lists the usual mistakes.
Formula
linear-gradient(angle, colour1 0%, colour2 100%) radial-gradient(circle, colour1 0%, colour2 100%) conic-gradient(from angle, colour1 0%, colour2 100%)
0deg goes bottom to top, 90deg left to right. Two stops at the same place make a hard line.
What the inputs mean
- Type
- Linear, radial or conic.
- Angle
- Direction for linear and conic.
- Colour stop
- Colour and position (%).
Worked example: 135° from indigo to pink
- Type linear, angle 135°.
- Stops #4f46e5 0%, #ec4899 100%.
- Code: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%).
Result: Paste the code into the background property.
How to read the result
Check contrast at the lightest and darkest points when placing text on a gradient.
Common mistakes
- Stops out of order.
- Banding with distant colours; add a middle stop.
- No solid fallback colour.
Frequently asked questions
Browser support?
All current browsers; conic is missing in very old ones.
Animated gradients?
Animate background-position; the gradient itself does not animate.
Is an image faster?
A CSS gradient needs no download.
The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.