What a CSS gradient is
Because the browser draws it at whatever size the element is, a gradient stays smooth at every screen size — no image to blur, stretch or download. Gradients replaced sliced background images for hero sections, buttons and cards: one line of CSS does the job, and a redesign means editing two colour codes.
Linear or radial: which one should you use?
Choose linear when the blend has a direction — across a header, down a page, deepening a button. Keywords and angles describe the same directions, and they line up exactly:
| Keyword | Angle |
|---|---|
| to top | 0deg |
| to top right | 45deg |
| to right | 90deg |
| to bottom right | 135deg |
| to bottom | 180deg |
| to bottom left | 225deg |
| to left | 270deg |
| to top left | 315deg |
Choose radial when the effect centres on a point: a glow behind a headline, a spotlight, a vignette darkening towards the corners. These radial gradients are circles starting at the position you pick — centre by default.
How to use this generator
Pick Linear or Radial at the top. For linear, tap a direction preset or drag the angle slider anywhere from 0° to 360°; for radial, choose where its centre sits. Then set your colours — each stop has a picker, a hex box and a position slider — and switch on the middle stop for a three-colour blend. The preview is painted with the exact CSS in the output panel: when it looks right, press Copy CSS and paste.
Colour stops: positions, midpoints and hard stripes
A colour stop is a colour pinned to a position, written as a percentage. The browser blends smoothly between neighbouring stops, so position controls where each colour reaches full strength. A middle stop at 50% shares the blend evenly; at 25% the first colour takes three quarters of the run. Two stops at the same position leave no distance to blend across, so the colour changes instantly at that line — a fade becomes a crisp two-tone split, or, repeated, stripes.
Adding the CSS to your site
Paste the declaration into the rule for the element you want to fill — body for a page wash, a hero class for a banner, a button class for a glossy call to action. One habit worth keeping: put a solid background-color line first, using your start colour, with the gradient after it. Modern browsers apply the gradient; anything too old shows the solid colour instead of nothing. Finally, check text contrast — light text needs the darker end behind it.
Browser support, stated honestly
The syntax this tool generates is the standard, unprefixed form, supported by all modern browsers — current Chrome, Edge, Firefox and Safari and years of older releases. No prefixes are needed. The honest limit is very old software: Internet Explorer 9 and earlier cannot render gradients at all — which is what the solid fallback colour in the previous section covers.