CSS Gradient Generator
Build a linear, radial or conic CSS gradient visually and copy the background rule, with no image files involved.
Preview
Options
background: linear-gradient(135deg, #1d4ed8, #7c3aed);Saving needs a Dex account. The tool never does.
How it works
- Pick linear, radial or conic, set an angle and two colours, and the preview fills with the gradient as you change them.
- The CSS rule underneath is the exact declaration to paste, with the angle rounded to whole degrees and colours as you typed them.
- Linear takes an angle, conic starts from an angle, and radial ignores the angle because it is centred. The control disables itself rather than pretending to do something.
- Everything is local arithmetic on colour strings. No image is generated, downloaded or uploaded.
Examples
A button background
A 135-degree linear gradient between two shades of the same hue gives depth without a second colour that fights the palette.
A hero section
A radial gradient from a light centre to a darker edge keeps text readable over the middle of the panel.
Frequently asked questions
Does a gradient need an image file?
No. CSS gradients are painted by the browser, so they stay sharp at any resolution and cost nothing to download.
How do I add more than two colours?
Not in this tool yet. Two stops cover most interface gradients; for more, write the linear-gradient by hand using the rule this tool produces as a starting point.
Can I animate it?
Yes. The output is a normal background declaration, so transition or keyframe it like any other. Animating a gradient angle needs a registered custom property, which is beyond what this tool generates.
Is anything sent anywhere?
No. The gradient is composed from your inputs in the page.