CSS Gradient Generator
Create linear CSS gradients as ready-to-use code.
Input
Output
What is CSS Gradient Generator?
CSS Gradient Generator creates a linear background declaration from an angle and two color pickers. It produces CSS text, with no background preview on this page. Use it for a two-color button, banner or card, then inspect the declaration on an element with the intended dimensions.
How to use CSS Gradient Generator
Set Angle to 90, Color 1 to #ff0000 and Color 2 to #0000ff, then choose Generate. Expect background: linear-gradient(90deg, #ff0000, #0000ff);. In CSS, 90deg points to the right: the first color is at the left end and the second at the right end.
When is CSS Gradient Generator useful?
Set Angle to 0 and generate again. The result starts with linear-gradient(0deg, and runs toward the top, with the first color below the second. At 180deg the direction is downward. These are CSS directions, not the angle convention of a drawing application. The number field also accepts negative angles; full turns describe equivalent directions.
Example
Copy the complete background declaration into your own selector, rather than pasting it as HTML. It contains two opaque color stops; it does not export an image, a class name or responsive variants. For an explicitly written radial gradient or additional stops, use the Gradient Builder and provide the gradient expression yourself.
Practical notes
The background shorthand replaces other background settings on the same element, so combine it carefully with existing images and sizing rules. Check text contrast across the whole gradient and in relevant states. The linear-gradient reference explains angles and color stops. Generation runs in the browser; the colors are not submitted to a server.