CSS Gradient Generator
Create a linear gradient and copy the ready-to-use CSS.
What this tool does
Gradients add depth and colour transitions to a design without image files. This tool builds the CSS for a gradient from your chosen colours and direction, so you can copy it straight into a stylesheet.
How to use this tool
- 1
Set the two colours
Hex values work; the preview follows what you type.
- 2
Adjust the angle
The CSS angle runs clockwise from the top, so 0° goes bottom to top and 90° goes left to right.
- 3
Copy the CSS
The declaration is ready for a stylesheet or an inline style.
When to use it
- You want a smooth colour background for a section or button.
- You need the correct CSS syntax for a linear or radial gradient.
- You are experimenting with colour transitions for a design.
- You want a lightweight alternative to a background image.
How to understand this tool
CSS angles are measured clockwise starting from "to top", which is the opposite of how most people sketch an arrow on paper. The output sets background-image rather than background-color, because a gradient counts as an image; that detail matters when another rule later overrides background-color.
What it will not do
- It only produces two-stop linear gradients.
- It does not add vendor prefixes or fallback colours for old browsers.
Questions people ask
What is the difference between linear and radial?
Linear gradients transition along a straight line; radial gradients spread outward from a point.
Can I use more than two colours?
Yes — add colour stops to blend through several colours.
One thing worth knowing
For passwords, use the longest length a service allows, and store the result in a password manager.