CSS Gradient Generator — linear and radial
Pick colours, drag stops, choose an angle. The CSS rule is generated and previewed live, ready to paste into your stylesheet.
Pick colours, drag stops, choose an angle. The CSS rule is generated and previewed live, ready to paste into your stylesheet.
background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
A CSS gradient is a smooth transition between two or more colours, generated by the browser without any image asset. The two flavours that ship in every modern browser are linear-gradient (a straight line of colour change at a chosen angle) and radial-gradient (concentric rings around a centre point).
Because gradients are computed in CSS, they scale to any size without losing quality, weigh nothing in the bundle, and respond to dark mode or media queries the same way any other CSS rule does. They are the right call for hero backgrounds, button highlights, card overlays and decorative dividers — anywhere you would otherwise drop a flat or noisy image.
Up to six in this tool — beyond that the gradient gets muddy and the CSS hard to maintain. The CSS spec itself does not impose a hard cap.
Linear sweeps colour along a straight axis (you set the angle). Radial sweeps colour outward from a centre point in concentric rings — great for spotlight or vignette effects.
Yes. linear-gradient and radial-gradient have full support in every modern browser since 2014. Older syntax with -webkit- and -moz- prefixes is no longer needed.
Banding usually appears on long gradients between similar colours. Avoid two stops where the colour difference is tiny over a large screen, add intermediate stops, or apply a slight noise overlay (background-image: linear-gradient(…), url(noise.png)).
Absolutely — generate two CSS rules, one per mode, and swap them with @media (prefers-color-scheme: dark) or a CSS variable. Keep the gradient direction the same to avoid visual disorientation.
Where a gradient delivers more visual punch than a flat colour.
A two-stop linear gradient between two on-brand colours adds depth without the weight of an image. Pair with a slight overlay for legible text.
Subtle radial gradients on cards (centre lighter than edges) imply elevation without a hard shadow. Linear gradients on CTA buttons add a press-affordance look.
A horizontal linear-gradient from transparent to a tint and back makes a soft divider that beats a flat 1px line on busy pages.
Animate a linear-gradient's background-position to produce the shimmer effect popular on skeleton placeholders. No JS needed.
Small choices that make gradients look professional.
Two colours separated by 30°-60° on the colour wheel almost always look better than complementary opposites. Tools like coolors.co can pick harmonious pairs.
A gradient that looks great in isolation can fight with text on top. Always preview with the headline and body copy in place; adjust opacity if needed.
Radial gradients are striking but draw attention away from content. Use one per page maximum, ideally for a spotlight effect on a CTA, not as a section background.
Define your gradient stops as --grad-start and --grad-end variables. Theming, dark mode and one-off overrides become a single line change instead of hunting through stylesheets.