How to Use the CSS Gradient Generator: Steps and a Worked Example
Generate CSS for a linear gradient between two colours. This guide shows what to enter, a worked example, and the limits to keep in mind. The CSS Gradient Generator tool is free, needs no account and runs in your browser.
What you need
- First colour, for example #2563eb
- Second colour, for example #9333ea
- Angle (degrees), for example 90
Step by step
- Open the CSS Gradient Generator tool.
- Fill in First colour.
- Fill in Second colour.
- Fill in Angle (degrees).
- Read the result, which updates as soon as the inputs change.
Worked example
With these inputs:
- First colour: #2563eb
- Second colour: #9333ea
- Angle (degrees): 90
the tool returns:
background: linear-gradient(90deg, #2563eb, #9333ea);
A second example
Changing Angle (degrees) 90 to 180 gives:
background: linear-gradient(180deg, #2563eb, #9333ea);
Comparing two runs like this is a quick way to see how much each input moves the result.
How it works
Enter two colours (hex, rgb() or a name) and an angle. 90deg runs left to right and 180deg top to bottom.
Things to keep in mind
Check your inputs, units and any local rules before you rely on the result.
Related tools
If this is not quite what you need, try CSS Border Radius Generator, CSS Box Shadow Generator or CSS Color Extractor.