How to Make a CSS Gradient Background

Gradients add depth to buttons, hero sections and cards with a single line of CSS and no image to download.

๐ŸŒˆFree CSS Gradient Generator
Linear, radial and conic gradients with live preview.
Open tool →

Linear gradients

background: linear-gradient(135deg, #19c6a6, #0b1b33); The angle sets the direction – 0deg points up, 90deg points right – and the colours are listed in order.

Radial and conic

radial-gradient spreads from the centre outwards, good for spotlights. conic-gradient sweeps around a point, used for pie charts and colour wheels.

Colour stops

Add a percentage after a colour to control where it sits: linear-gradient(90deg, red 0%, orange 30%, yellow 100%).

Keep text readable

Check your text colour against both ends of the gradient with the Color Contrast Checker. Similar hues with a change in lightness look more professional than two unrelated bright colours.

Generate it

Pick colours and an angle in the CSS Gradient Generator and copy the code.

Frequently asked questions

Do all browsers support gradients?

Yes – every current browser.

Can I use a gradient on text?

Yes, with background-clip: text and a transparent text colour.

Are gradients bad for performance?

No.

๐ŸŒˆFree CSS Gradient Generator
Linear, radial and conic gradients with live preview.
Open tool →

More guides