Blog
Custom Print on Demand Apparel — Free Storefront for Your Business
Wild & Free Tools

How to Make CSS Gradients — Linear, Radial & Multi-Color Guide

Last updated: April 20268 min readDeveloper Tools

CSS gradients look intimidating in code but follow a simple pattern: type, direction, colors. Once you understand the syntax, you can build any gradient from scratch — or use a visual builder to skip the syntax entirely.

Linear Gradient — Step by Step

Linear gradients flow color in a straight line. The syntax:

background: linear-gradient(direction, color1 position, color2 position);

Direction ValueVisual ResultExample
to right (or 90deg)Left → Rightlinear-gradient(to right, #667eea, #764ba2)
to bottom (or 180deg)Top → Bottomlinear-gradient(to bottom, #f093fb, #f5576c)
135degDiagonal (top-left → bottom-right)linear-gradient(135deg, #a8edea, #fed6e3)
to top-left (or 315deg)Bottom-right → Top-leftlinear-gradient(to top-left, #00f260, #0575e6)
45degDiagonal (bottom-left → top-right)linear-gradient(45deg, #f7971e, #ffd200)

Key insight: 0deg points upward (bottom to top). Degrees increase clockwise — 90deg is left to right, 180deg is top to bottom. Keywords like "to right" are more readable when direction matters more than precise angle.

Radial Gradient — Step by Step

Radial gradients spread color outward from a center point:

background: radial-gradient(shape size at position, color1, color2);

PropertyOptionsExample
Shapecircle, ellipse (default)radial-gradient(circle, #f7971e, #ffd200)
Sizeclosest-side, farthest-corner, exact pxradial-gradient(circle 200px, #f00, #00f)
Positionat center (default), at top left, at 25% 75%radial-gradient(circle at top left, #f00, #00f)
Multiple stopsAdd colors with positionsradial-gradient(circle, #fff 0%, #eee 70%, #999 100%)

Radial gradients create natural spotlight effects. A light center fading to a darker edge mimics real-world lighting — use it for hero sections, image vignettes, or circular highlights.

Conic Gradient — Step by Step

Conic gradients sweep color around a center point like a clock:

background: conic-gradient(from angle at position, color1, color2);

Use CaseCSSResult
Color wheelconic-gradient(red, yellow, lime, aqua, blue, magenta, red)Full rainbow sweep
Pie chartconic-gradient(#f5576c 0% 40%, #667eea 40% 70%, #4facfe 70% 100%)Three colored sections
Subtle sweepconic-gradient(from 45deg, #161b22, #21262d, #161b22)Dark mode decorative ring

Adding Color Stops

Color stops give you precise control over where each color appears:

Hard stops (same position for end of one color and start of next) create stripes. Separated stops create smooth transitions. The gradient generator lets you drag stops visually instead of guessing percentages.

Repeating Gradients

Repeating gradients tile a small pattern across the element:

Layering Multiple Gradients

Stack gradients using commas. The first gradient is on top:

Text Gradients (background-clip Trick)

Create gradient text in three CSS properties:

  1. background: linear-gradient(90deg, #f5576c, #667eea);
  2. -webkit-background-clip: text; background-clip: text;
  3. color: transparent;

The gradient becomes the text color. Works in all modern browsers. Pair with large headings for maximum visual impact — small text gradients are hard to see.

Common Mistakes

MistakeWhy It HappensFix
Gradient looks flatOnly two very similar colorsIncrease color contrast between stops
Wrong directionConfusing degree systemRemember: 0deg = bottom→top, 90deg = left→right
Adding vendor prefixesCopied old code from Stack OverflowRemove -webkit- prefix — not needed since ~2015
Gradient does not showApplied to inline elementGradients need a block/inline-block element with dimensions
Color bandingLarge area, similar colorsAdd intermediate stops or a subtle noise overlay

Tools for Your Gradient Workflow

Skip the syntax — build CSS gradients visually and copy the code.

Open Gradient Generator
Launch Your Own Clothing Brand — No Inventory, No Risk