Worked example
For a warm hero banner, choose Linear, set the angle to 135° (top-left to bottom-right), make the first stop coral #ff7e5f at 0% and the second peach #feb47b at 100%. The code is background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);, with background: #ff7e5f; on the line before as a fallback.
Gradient recipes
linear-gradient(90deg, #2193b0 0%, #6dd5ed 100%)radial-gradient(circle at center, #ffffff 0%, #1e293b 70%)conic-gradient(from 0deg at center, #ff0000 0%, #00ff00 33.3%, #0000ff 66.7%, #ff0000 100%)linear-gradient(90deg, #0f766e 0%, #0f766e 50%, #f59e0b 50%, #f59e0b 100%)Tips for good gradients
- Neighbouring hues (blue to teal, orange to pink) blend more cleanly than opposite ones, which can turn grey in the middle.
- Keep text readable: test the lightest and darkest parts behind your text with the contrast checker.
- Stack gradients with commas to layer a subtle overlay on a photo: linear-gradient(rgb(0 0 0 / 0.4), transparent), url(photo.jpg).
- Use repeating-linear-gradient for stripes and patterns without images.
Accessibility and performance
Gradients are drawn by the browser, so they cost no download and stay sharp at any screen size, unlike a background image. If text sits on top, check contrast at both ends of the blend, not just the middle, and give the element a solid background colour first so the text stays readable if the gradient fails to load or the page is printed. People who turn on high-contrast or forced-colours modes in Windows may not see background gradients at all, which is another reason never to put important information only in a gradient. For subtle backgrounds, keep the two colours close in lightness; a large lightness jump draws the eye away from the content.
Related tools
- URL encode and decode
- Colour converter
- XML formatter and validator
- SQL formatter
- Box shadow generator
- HTML and CSS minifier
- Meta tag analyzer
- Colour palette generator
- Contrast checker
- JSON to CSV
Sources
Checked on November 26, 2026:
Frequently asked questions
How do I make a gradient in CSS?
What is the difference between linear, radial and conic?
How do I make hard edges instead of a blend?
Do I need -webkit- prefixes?
Can I put a gradient on text?
Why does my gradient look banded?
Last updated: 2026-11-26