How to make a CSS gradient and copy the code
A gradient is just CSS, but writing the angle and colours by hand is fiddly. CSS gradient generator shows a live preview as you change them.
Steps
- Choose Linear, Radial or Conic.
- Set the angle with the slider.
- Pick the first and last colours, and tick Add a middle colour for three.
- Copy the CSS into your stylesheet.
Use cases
- Hero section and button backgrounds.
- Quick placeholder backgrounds.
- Learning how gradient syntax works.
Tips
- Gradients between very different colours can look muddy in the middle. A third colour helps.
- Put text over a gradient only after checking contrast with the Colour contrast checker.
- Need matching colours? Try the Colour palette generator.