The three gradient types
Linear gradients
Colors transition along a straight line at a specified angle. This is the most common and most versatile gradient type.
background: linear-gradient(135deg, #267D70 0%, #8BAF9E 100%);
The angle is measured clockwise from "pointing up": 0deg goes bottom-to-top, 90deg left-to-right, 180deg top-to-bottom. The color stops can include any number of intermediate colors.
Radial gradients
Colors transition outward from a central point in a circle or ellipse. Best for spotlights, glows and atmospheric backgrounds.
background: radial-gradient(circle at top, #00C9FF 0%, #92FE9D 100%);
The center can be positioned with at top, at bottom right, at 30% 40%, etc. Shape can be circle or ellipse.
Conic gradients
Colors transition around a central point, like slices of a pie. Best for progress indicators, color wheels and playful accents.
background: conic-gradient(from 0deg at center, #667EEA 0%, #764BA2 25%, #F093FB 50%, #F5576C 75%, #667EEA 100%);
The from angle rotates the starting point. Conic gradients are typically used to create rings, charts and color-wheel visualizations.
The seven pitfalls
1. Muddy middles
Two far-apart colors on the color wheel can blend into a dull gray in the middle. Blending #FF0000 (red) with #00FF00 (green) gives you brown in the middle — not yellow as you might expect, because RGB interpolation is not the same as paint mixing.
Fix: add an intermediate stop that keeps saturation high, or pick two colors that are closer on the color wheel.
2. Overly aggressive angles
Steep diagonal gradients (like 45deg) look more dramatic than horizontal or vertical ones, but they can make text harder to read. When in doubt, use a vertical gradient (180deg) or horizontal (90deg).
3. Gradients under text
Text over a gradient must maintain contrast at every point of the gradient, not just the ends. A gradient from dark navy to medium blue may fail on the medium blue end.
Fix: test contrast at both ends with our Contrast Checker, or add a semi-transparent overlay behind text.
4. Too many stops
Three or four stops are usually plenty for a hero section. A gradient with seven stops often looks noisy and unfocused. The exception is intentionally "rainbow" or "spectrum" gradients, which are a deliberate aesthetic choice.
5. Gradients that don't fade cleanly
A gradient from one color to another needs both ends to make sense in the context. If a gradient fades from a strong brand color to pure white, the user sees a jarring transition from brand to background. Fade to a very light tint of the brand color instead.
6. Ignoring dark mode
Gradients that look good on a white page can look completely different on a dark page. A light-to-dark gradient in light mode becomes dark-to-darker in dark mode — which is a different design entirely.
7. Animation without purpose
Animated gradients (using CSS @keyframes on background-position) can be beautiful or distracting. If you use them, ensure they respect prefers-reduced-motion — animated backgrounds can cause discomfort for some users.
Practical gradient patterns that work
The two-stop brand fade
A simple two-stop gradient from your primary color to a slightly darker or lighter variant. Used for hero sections, cards, or buttons.
background: linear-gradient(135deg, #267D70 0%, #1E6359 100%);
The three-stop atmospheric
A three-stop gradient that passes through a distinct mid-color. Used for larger hero areas where you want an atmospheric feel.
background: linear-gradient(180deg, #F4D03F 0%, #F5AF19 50%, #E67E22 100%);
The subtle surface gradient
A gradient between two very similar neutrals — subtle enough that it reads as a "surface" rather than a "gradient". Used for cards and panels.
background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
The radial spotlight
A radial gradient for atmospheric backgrounds — a bright center that fades into a solid dark edge.
background: radial-gradient(circle at 30% 20%, #8BAF9E 0%, #202A27 70%);
Building your own
Use our Gradient Generator to build and preview gradients interactively, and the CSS Gradient Generator for a simpler linear-only workflow with copy-ready output.