UCSSR

Gradient Generator

Create beautiful CSS gradients with visual controls and live preview

Scroll to see more →
90°
CSS Code

Ready to use in your project

Format:
1background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
Gradient Guide
Master the art of CSS gradients and color transitions

CSS gradients let you display smooth transitions between two or more colors. They create beautiful backgrounds, buttons, and decorative effects without using images, reducing load time and improving scalability.

1Types of Gradients

Linear
linear-gradient(90deg, ...)
Straight line transitions
Radial
radial-gradient(circle, ...)
Radiates from center
Conic
conic-gradient(from 0deg, ...)
Rotates around center

2Understanding Gradient Anatomy

0%
50%
100%
Direction: 90°
background: type(direction, stops);
Color StopsDefine colors and positions (0% to 100%)
DirectionAngles (deg) or positions (at center)
Typelinear, radial (circle/ellipse), conic

3Common Patterns

Diagonal
linear-gradient(135deg, ...)
Headers & hero sections
Fade
linear-gradient(90deg, ...)
Overlays & containers
Spotlight
radial-gradient(circle, ...)
Focus & hover effects

4Design Principles

Color Harmony

Choose colors that complement each other for professional results.

Monochromatic

Analogous

Triadic

Contrast & Readability

Ensure text remains readable across all gradient ranges.

Light on Dark
Dark on Light

5Advanced Techniques

Custom Stops
color 10%, color 30%, color 90%
Uneven color distribution
Repeating
repeating-linear-gradient(...)
Stripes & patterns
Borders
border-image: linear-gradient(...)
Gradient outlines

6Quick Reference

to-top
0deg / to top
to-right
90deg / to right
to-bottom
180deg / to bottom
to-left
270deg / to left
diagonal
135deg / to bottom-right
radial
radial-gradient(circle, ...)

7Best Practices

✓ Do

  • • Use subtle transitions for professional designs
  • • Maintain contrast for readable text
  • • Test across devices and screens
  • • Consider color accessibility

⚠️ Avoid

  • • Too many color stops (keep it simple)
  • • Harsh, abrupt transitions
  • • Overusing gradients on a page
  • • Animating gradient positions directly

What is CSS Gradient Generator?

CSS gradients let you create smooth transitions between two or more colors without using image files. The `background-image` property supports three gradient functions: `linear-gradient()` for directional transitions, `radial-gradient()` for circular/elliptical transitions, and `conic-gradient()` for angle-based transitions. Gradients reduce HTTP requests compared to background images, scale perfectly on any screen, and are hardware-accelerated in modern browsers.

Read the full CSS Gradients guide

Tips & Best Practices

  • 1Use at least 3 color stops for richer gradients — two-color gradients often look flat.
  • 2Set explicit color stop positions (e.g., `#ff0000 30%`) for more control over color distribution.
  • 3Layer multiple gradients using comma-separated values in `background-image` for complex effects.
  • 4Use `background-size` with `background-repeat` to create gradient-based patterns.
  • 5For text gradients, combine `background-clip: text` with `-webkit-text-fill-color: transparent`.
  • 6Test gradients on both light and dark backgrounds — some combinations lose contrast.

Frequently Asked Questions

Linear gradients transition colors along a straight line (top to bottom, left to right, or at an angle). Radial gradients transition colors outward from a center point in a circular or elliptical shape. Conic gradients transition colors around a center point, like a color wheel.

CSS gradients cannot be directly transitioned with the `transition` property. However, you can animate them using CSS `@property` (Houdini) to register custom properties as colors, or by animating the `background-position` of an oversized gradient.

Apply a gradient as the background, then use `background-clip: text` and `-webkit-text-fill-color: transparent`. The gradient will show through the text shape. Note: `background-clip: text` requires the `-webkit-` prefix in some browsers.

Linear and radial gradients are supported in all modern browsers (Chrome, Firefox, Safari, Edge). Conic gradients have slightly less support but work in all current browser versions. Use the Cross-Browser output mode for vendor-prefixed fallbacks.

Apply the gradient to the `body` or `html` element and set `min-height: 100vh` along with `background-attachment: fixed` to prevent the gradient from repeating on scroll.