Map Extract
Free tool

CSS gradient generator

Blend two or more colours into a background for a hero banner, a button or a section divider. Adjust the stops on a live preview and copy CSS that includes a plain colour fallback.

Runs in your browser. Nothing you enter is uploaded.

Making a gradient

  1. Choose the type

    Linear runs in a straight line, Radial spreads out from the centre in a circle, Conic sweeps round a point like a pie chart.

  2. Set the angle

    For linear and conic gradients, drag the angle from 0° to 360°. At 90° a linear gradient runs left to right; 135° runs diagonally down to the right.

  3. Edit the colour stops

    Pick each colour and slide its position from 0% to 100%. Add stops up to six in total, or remove any beyond the first two.

  4. Copy the CSS

    The output has two background lines: a solid first colour for very old browsers, then the gradient.

Example: a three-colour hero background

A web designer is building a landing page for a garden design company and wants a hero banner that moves from deep blue through a mid blue to fresh green.

With a linear gradient at 135°, stops at #0B3D91 0%, #1E6FA8 60% and #A3E635 100%, the CSS is below. Placing the middle stop at 60% keeps most of the banner blue, with the green only in the bottom right corner, behind the call to action.

Input
Linear, 135°, #0B3D91 0%, #1E6FA8 60%, #A3E635 100%
Result
background: #0B3D91;
background: linear-gradient(135deg, #0B3D91 0%, #1E6FA8 60%, #A3E635 100%);

The three gradient types

TypeSample outputGood for
Linearlinear-gradient(135deg, ...)Banners, buttons, page backgrounds
Radialradial-gradient(circle, #FFFFFF 0%, #E1EFFA 100%)Soft spotlight behind a product or headline
Conicconic-gradient(from 90deg, ...)Pie-style charts, colour wheels, decorative rings

Text on a gradient

Text has to be readable over every part of the gradient, not just the middle. Check your text colour against both the lightest and the darkest stop with the colour contrast checker. If one end fails, darken that stop or keep the text over the darker part of the banner.

Questions people ask

How do I make a gradient background in CSS?

Set the background property to a gradient function, such as linear-gradient(135deg, #0B3D91 0%, #A3E635 100%). Build it here by choosing colours and positions, then paste both lines of the output into your stylesheet; the first gives a solid colour if a browser cannot draw gradients.

What does the angle mean in a linear gradient?

It is the direction the gradient travels. 0 degrees runs from bottom to top, 90 from left to right, 180 from top to bottom and 270 from right to left. Values in between run diagonally, so 135 goes from the top left towards the bottom right.

Why does my gradient look banded?

Smooth gradients between similar colours over a large area can show faint steps on some screens, especially in dark colours. Adding a middle stop, picking colours a little further apart or a subtle noise texture behind the gradient all reduce the effect.

Where your data goes

The gradient and its CSS are produced in your browser. Your colours are not sent anywhere.

Checked against the tool on

Top