Build a two-color CSS gradient
Gradient Generator creates a linear-gradient() background from two opaque HEX colors and an angle. It outputs CSS, not a raster image or SVG download.
Set the endpoints
- Enter the first and second colors as three- or six-digit HEX.
- Move the angle slider from
0to360degrees. - Inspect the updated preview and select the output declaration.
- Paste that declaration inside the destination element's CSS rule.
Example: blue to white horizontally
With #2563eb, #ffffff and angle 90, the output is background: linear-gradient(90deg, #2563eb, #ffffff);. CSS 90 degrees points right; 0 degrees points up. Rotate the angle to change direction without swapping the endpoints.
Can I add extra stops or transparency?
The interface supports exactly two opaque endpoint colors. You can manually add more stops or alpha values to the copied CSS elsewhere, but this page will not preview those edits.
Is text over the gradient accessible?
Different positions have different background colors. Evaluate the weakest contrast behind the text, including responsive positions where the text moves. Contrast Checker compares explicit pairs; it does not automatically inspect this whole gradient.
The browser renders the preview, so color management can affect appearance. Keeping the result as CSS lets the gradient scale with its element rather than baking it into a fixed-resolution image.





