Use this free CSS gradient generator to create linear, radial, and conic gradients for backgrounds, buttons, and banners. Choose a type, pick two or three colors, set the angle, and copy the CSS. The preview updates as you change each setting. Everything is built in your browser, so nothing you choose is sent to our servers.
A CSS gradient is drawn by the browser, so it needs no image file. It loads quickly and scales to any screen size.
How to use the CSS gradient generator
- Choose the type: linear for a straight band, radial for a glow from the center, or conic for a sweep around a point.
- Choose the colors: set a start color and an end color. Add a middle color for three stops.
- Set the angle: turn the direction of linear and conic gradients.
- Copy: copy the finished
backgroundrule and paste it into your stylesheet.
Gradient types at a glance
| Type | Function | Best for |
|---|---|---|
| Linear | linear-gradient() | Page backgrounds and section bands |
| Radial | radial-gradient() | Spotlight or glow effects |
| Conic | conic-gradient() | Pie charts, rings, and color wheels |
Worked examples
A button background
Choose linear, purple to orange, and an angle of 135°. The output is background: linear-gradient(135deg, #6D28D9, #F97316);.
A soft spotlight
Choose radial with a light and a dark color. The center is the first color and the edge fades to the second.
A three-color banner
Turn on the middle color and set a horizontal angle of 90°. The banner moves smoothly through all three colors from left to right.
Common mistakes
- Mixing up the angle direction. 0° points up, not right. Check the preview before copying.
- Low text contrast. Text placed on a gradient may be hard to read in some areas. Test the contrast.
- Forgetting a fallback color. Add a plain
background-colorabove the gradient rule for very old browsers.
Frequently asked questions
What is a CSS gradient?
A CSS gradient is an image made from a smooth transition between two or more colors. It is set with the background property and needs no image file.
What is the difference between linear, radial, and conic gradients?
A linear gradient changes color along a straight line at an angle. A radial gradient spreads outward from a center point. A conic gradient sweeps around a center point, like the hands of a clock.
What do the angle and color stops mean?
The angle sets the direction of a linear gradient in degrees, where 0 is upward and 90 is to the right. Color stops are the colors and the positions along the gradient where they appear.
Does the CSS work in all browsers?
Modern browsers support linear, radial, and conic gradients. Older browsers may need a fallback background color, which you can add before the gradient rule.
Is the Xornex CSS gradient generator free?
Yes. The Xornex CSS gradient generator is available to use free of charge.