CSS Gradient Generator
Build linear or radial CSS gradients — drag stops, adjust angle, copy background shorthand.
How to Use
- Pick gradient type: linear (straight-line transition) or radial (concentric circle).
- For linear gradients, set the angle (0° = top, 90° = right, 180° = bottom, 270° = left).
- Add color stops with the "+ Add stop" button. Drag stops along the bar to reposition.
- Click each stop to change its color via the color picker.
- The live preview shows the gradient at full size; the CSS output below updates instantly.
- Click Copy CSS to put the generated background shorthand on your clipboard.
Output
Frequently Asked Questions
What's the difference between linear and radial gradients?
Linear gradients transition colors along a straight line (top-to-bottom, left-to-right, or any angle). Radial gradients transition outward from a center point in concentric rings. Linear is what you'd use for a sky background (light at top, darker at bottom); radial is what you'd use for a sun glow effect (bright center fading outward).
How do I make a smooth gradient?
Use 2–3 color stops, transition between perceptually-close colors (similar hue, similar lightness), and avoid sharp jumps. The default mid-stop position is 50% — moving it shifts where the color transition happens. For very smooth gradients, blend in HSL or LCH color space rather than RGB (modern CSS supports <code>linear-gradient(in oklch, ...)</code>).
What about conic gradients?
Conic gradients (color rotating around a center point — like a pie chart) are supported by all modern browsers via CSS <code>conic-gradient()</code>. This generator focuses on linear and radial; for conic, write the CSS manually: <code>conic-gradient(from 0deg, red, yellow, green, red)</code>.
Why does my gradient look 'muddy' in the middle?
RGB interpolation between two saturated complementary colors (red and green, blue and yellow) passes through dull gray at the midpoint because the average of bright red and bright green is mathematical gray. To fix: add an intermediate stop at the midpoint with a vibrant color, or use HSL/LCH interpolation which travels through the color wheel rather than the RGB cube.
How do I add a gradient to a button or card?
Apply it as background or background-image. <code>background: linear-gradient(135deg, #6366f1, #ec4899);</code> on the button. For multi-layer effects, you can stack gradients with multiple background values separated by commas — useful for overlay tints over images.
Will my gradient render in older browsers?
Linear and radial gradients are supported in every browser released since about 2012. Newer features (in oklch, multi-position stops, double-percentage stops) require recent versions. For very old browsers (IE 11 and earlier), you'd need vendor prefixes and fallback solid colors — but those browsers are essentially extinct in 2026.
Common Use Cases
Hero section backgrounds
Generate brand-aware gradient backgrounds for landing pages and marketing sites.
Button and CTA styling
Add subtle gradients to call-to-action buttons for visual interest without garish solid colors.
Card and panel backgrounds
Apply soft gradients to dashboard cards or content panels for visual hierarchy.
Icon and avatar backgrounds
Generate consistent, programmatic gradient backgrounds for user avatars or app icons.
Image overlay tints
Layer a semi-transparent gradient over background images to ensure text contrast.
Loading states and skeletons
Animated gradients (with @keyframes) make for elegant loading-state shimmer effects.
Last updated: