Developer Tools

CSS Gradient Generator with Worked Examples

Generate CSS for a linear gradient between two colours. Enter first colour, second colour and angle and read the result straight away. Example: first colour “#2563eb”, second colour “#9333ea” and angle 90 degrees → background: linear-gradient(90deg, #2563eb, #9333ea);.

01

Your inputs

Start with the example, or enter your own values.

Processed in your browser. Your inputs stay on this device.

02

Your result

A little clarity, coming right up.

Make room for the answer.

Enter your values and run the tool. Your result will appear here.

How to use the CSS Gradient Generator

Enter two colours (hex, rgb() or a name) and an angle. 90deg runs left to right and 180deg top to bottom.

Examples

  • With the default values
    background: linear-gradient(90deg, #2563eb, #9333ea);
  • With angle set to 180
    background: linear-gradient(180deg, #2563eb, #9333ea);

Limitations and assumptions

Confirm assumptions, units and applicable local rules before relying on results. Detailed content, accessibility and edge-case review remains ongoing.

Frequently asked questions

What does the CSS Gradient Generator do?

Generate CSS for a linear gradient between two colours.

How does the CSS Gradient Generator work?

Enter two colours (hex, rgb() or a name) and an angle. 90deg runs left to right and 180deg top to bottom.

What should I keep in mind when using the CSS Gradient Generator?

Confirm assumptions, units and applicable local rules before relying on results.

Can I see an example of the CSS Gradient Generator?

Example: first colour “#2563eb”, second colour “#9333ea” and angle 90 degrees → background: linear-gradient(90deg, #2563eb, #9333ea);.

Is the CSS Gradient Generator free to use?

Yes. It is free, needs no account and runs in your browser.