Skip to content

Free tool

CSS Gradient Generator

Build beautiful CSS gradients with a visual editor. Choose linear, radial, or conic, add color stops, and copy the generated CSS code.

Gradient Type
Angle: 135°
Color Stops
0%
100%
Generated CSS
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

Preset Gradients

What Are CSS Gradients?

CSS gradients let you display smooth color transitions entirely in code, without image files. They are defined using CSS functions like linear-gradient(), radial-gradient(), and conic-gradient() and are treated as background images. This means they scale perfectly on retina displays, load instantly, and can be layered with other backgrounds.

Gradients are one of the most versatile tools in CSS. You can use them for hero sections, buttons, text effects, overlays, border decorations, and even complex patterns. Because they are generated by the browser, they add zero weight to your page load.

Types of CSS Gradients

Linear Gradients

Linear gradients transition colors along a straight line. You control the direction with an angle (e.g., 135deg) or keywords like to right or to bottom left. They are the most commonly used gradient type, perfect for backgrounds, banners, and overlays.

Radial Gradients

Radial gradients radiate outward from a center point. By default they form a circle or ellipse, but you can control the shape, size, and position. They work well for spotlight effects, glowing buttons, and circular highlights.

Conic Gradients

Conic gradients rotate colors around a center point, like a color wheel. They are useful for pie charts, progress indicators, and decorative effects. You can set the starting angle and position to fine-tune the look.

How to Use CSS Gradients in Your Designs

  1. Start with two colors. Most effective gradients use just two colors. Adding too many stops can create a muddy result. Pick colors that are adjacent on the color wheel for harmony, or contrasting colors for energy.
  2. Use color stops to control transitions. Each color stop defines where a color appears along the gradient line. Moving stops closer together creates a sharper transition; spacing them apart makes it smoother.
  3. Layer gradients for depth. CSS allows multiple background layers. Stack a subtle gradient over a solid color, or combine a radial highlight with a linear base for a more complex effect.
  4. Always set a fallback. Add a solid background-color before your gradient. Older browsers and email clients that do not support gradients will display the fallback instead of a broken layout.
  5. Test on multiple screens. Gradients can look different on various displays due to color gamut and calibration differences. Check your gradient on both standard and high-DPI screens.

Frequently asked questions

A CSS gradient is a smooth transition between two or more colors rendered directly by the browser. Gradients are defined as background images, not solid colors, which means they can be layered, animated, and combined with other backgrounds. They eliminate the need for image files and scale perfectly on any screen size.

More free tools