CSS Gradients: 30 Beautiful Examples You Can Copy

By Taylor Feb 22, 2026 14 min read

CSS gradients are one of the most powerful visual tools available to web developers. They eliminate the need for gradient images, reduce HTTP requests, scale perfectly at any resolution, and can be animated. Whether you need a subtle background, a striking hero section, or a gradient text effect, CSS has you covered.

This guide provides 30 production-ready gradient examples organized by type, along with the theory behind each gradient function. Every example includes the CSS code and a live preview you can see right here on the page.

Table of Contents
  1. Linear Gradients (10 Examples)
  2. Radial Gradients (10 Examples)
  3. Conic Gradients (5 Examples)
  4. Advanced Techniques (5 Examples)
  5. CSS Gradient Syntax Explained
  6. Color Stops and Transitions
  7. Performance Considerations
  8. Browser Support
  9. Pro Tips

1. Linear Gradients

Linear gradients create a color transition along a straight line. You can control the direction using angles (e.g., 45deg) or keywords (e.g., to right). They are the most commonly used gradient type and are perfect for backgrounds, buttons, and overlays.

Cosmic Fusion
linear-gradient(135deg, #667eea 0%, #764ba2 100%)
Warm Sunset
linear-gradient(120deg, #f6d365 0%, #fda085 100%)
Soft Pastel
linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)
Midnight City
linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%)
Sunset Vibes
linear-gradient(to right, #fc5c7d, #6a82fb)
Cool Ocean
linear-gradient(135deg, #00c6fb 0%, #005bea 100%)
Fire
linear-gradient(135deg, #f5af19 0%, #f12711 100%)
Fresh Mint
linear-gradient(to right, #43e97b 0%, #38f9d7 100%)
Purple Haze
linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%)
Dark Teal
linear-gradient(to right, #0f2027, #203a43, #2c5364)

2. Radial Gradients

Radial gradients radiate outward from a center point. They create circular or elliptical color transitions that are perfect for spotlight effects, glowing orbs, and organic backgrounds. The shape can be circle or ellipse (default), and you can control the position with keywords like at center or percentage values.

Spotlight
radial-gradient(circle at 30% 40%, #6366f1, #0f172a)
Peach Glow
radial-gradient(ellipse at center, #ffecd2 0%, #fcb69f 100%)
Lavender Dream
radial-gradient(circle at top right, #a18cd1 0%, #fbc2eb 100%)
Rainbow Burst
radial-gradient(circle at 50% 50%, #ff6b6b 0%, #feca57 25%, #48dbfb 50%, #ff9ff3 75%, #54a0ff 100%)
Deep Space
radial-gradient(circle at center, #1a1a2e 0%, #16213e 50%, #0f3460 100%)
Electric Blue
radial-gradient(ellipse at bottom, #00d2ff 0%, #3a47d5 100%)
Rose Burst
radial-gradient(circle at 70% 30%, #f857a6 0%, #ff5858 100%)
Emerald Glow
radial-gradient(circle at 20% 80%, #2af598 0%, #009efd 100%)
Subtle Vignette
radial-gradient(circle at center, rgba(99,102,241,0.3) 0%, transparent 70%), #0f172a
Solar Flare
radial-gradient(circle at 50% 0%, #ffd700 0%, #ff8c00 50%, #ff4500 100%)

Build Your Own Gradients

Use Gradient Forge to create custom linear, radial, and conic gradients with a visual editor. Drag color stops, adjust angles, and copy CSS instantly.

Open Gradient Forge

3. Conic Gradients

Conic gradients sweep color transitions around a center point, like the hands of a clock. They are ideal for pie charts, color wheels, and decorative backgrounds. The conic-gradient() function uses angular values instead of linear positions.

Color Wheel
conic-gradient(from 0deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #ff6b6b)
Violet Spin
conic-gradient(from 45deg, #6366f1, #8b5cf6, #ec4899, #6366f1)
Dark Prism
conic-gradient(from 0deg at 50% 50%, #0f172a 0deg, #6366f1 120deg, #ec4899 240deg, #0f172a 360deg)
Pie Chart
conic-gradient(#f87171 0% 25%, #fbbf24 25% 50%, #34d399 50% 75%, #60a5fa 75% 100%)
Sweep Highlight
conic-gradient(from 0deg, transparent, #6366f1, transparent)

4. Advanced Techniques

These examples combine multiple gradient layers, use repeating gradients, or apply gradients to text and borders for more creative effects.

Gradient Text

Apply a gradient as a text color using background-clip: text. This technique works in all modern browsers.

.gradient-text {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

Gradient Border

Create gradient borders using a background layer technique since CSS border does not support gradients directly.

.gradient-border {
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #667eea, #764ba2) border-box;
  border: 2px solid transparent;
  border-radius: 12px;
}

Layered Gradients

Layered Aurora
linear-gradient(135deg, rgba(102,126,234,0.4) 0%, transparent 50%), linear-gradient(225deg, rgba(118,75,162,0.4) 0%, transparent 50%), #0f172a

Repeating Gradients

Diagonal Stripes
repeating-linear-gradient(45deg, #0f172a, #0f172a 10px, #1e293b 10px, #1e293b 20px)

Mesh-like Effect

Mesh Gradient
radial-gradient(at 40% 20%, #6366f1 0%, transparent 50%), radial-gradient(at 80% 0%, #ec4899 0%, transparent 50%), ..., #0f172a

5. CSS Gradient Syntax Explained

All three gradient types follow a consistent syntax pattern. Understanding this pattern means you can create any gradient from scratch without looking up the docs.

Linear gradient syntax
linear-gradient( direction, color-stop1, color-stop2, ... )

direction: angle (45deg, 135deg) or keyword (to right, to bottom left)
color-stop: color + optional position (red 20%, blue 80%)
Radial gradient syntax
radial-gradient( shape size at position, color-stop1, color-stop2, ... )

shape: circle | ellipse (default: ellipse)
size: closest-side | farthest-corner | explicit size
position: center | top left | 30% 40% (default: center)
Conic gradient syntax
conic-gradient( from angle at position, color-stop1, color-stop2, ... )

angle: rotation start (from 45deg) (default: 0deg)
position: center point (default: center)
color-stop: color + angular position (red 0deg, blue 180deg)

6. Color Stops and Transitions

Color stops are the positions where colors are defined in a gradient. Between stops, the browser automatically interpolates a smooth transition. You have full control over where these stops are placed.

7. Performance Considerations

CSS gradients are generally very performant because they are rendered by the GPU. However, there are a few things to keep in mind for complex gradient usage.

8. Browser Support

As of 2026, CSS gradient support is excellent across all modern browsers.

9. Pro Tips

Design Gradients Visually

Gradient Forge gives you a visual editor for linear, radial, and conic gradients with drag-and-drop color stops, 20+ presets, and one-click CSS copy.

Open Gradient Forge