Toolzweb
Guide

How to Make a CSS Gradient and Copy the Code (Free)

A gradient is a smooth blend between colors. It can make a button, a header or a whole page look modern, and it takes only one line of CSS.

The three gradient types

How to make one

  1. Open the CSS Gradient Generator and choose linear, radial or conic.
  2. Change the colors and their positions. You can add up to six colors.
  3. Set the angle for linear and conic gradients.
  4. Copy the CSS and paste it into your stylesheet, or download a PNG.

How to use the code

Paste the code inside any CSS rule, for example .hero or body. You can also put the value in a style attribute. The code includes a solid fallback color line for very old browsers, followed by the gradient.

Tips

Use colors that are close on the color wheel for a smooth, calm look. Check that text on top of the gradient stays easy to read with the Color Contrast Checker.

Make your gradient

Free, with no sign-up.

Open the Gradient Generator

Frequently asked questions

Does it work in all browsers?

Linear and radial gradients work everywhere. Conic gradients work in current versions of all major browsers.

Can I download the gradient as an image?

Yes. Press Download PNG for a 1600 by 900 image. Conic gradients need a recent browser.

Is the CSS gradient generator free?

Yes. Make as many gradients as you like, with no sign-up.

More guides