Text Tools: JSON Formatter YAML to JSON JSON to XML Base64 Color Contrast Color Converter Regex Tester Markdown to HTML Hash Generator UUID Generator Lorem Ipsum Slug Generator CSS Gradient

CSS Gradient Generator

Build linear & radial gradients visually and copy the CSS | Free & Private

Gradient Generator

Generated CSS
background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
Type
135°

Color Stops

Presets

Live Preview

Every change updates the preview and the CSS instantly — no guessing.

Multiple Stops

Add up to 8 color stops and drag each one's position along the gradient.

Linear & Radial

Switch between directional linear blends and circular or elliptical radial glows.

Copy-Ready CSS

Clean, unprefixed CSS that works in every modern browser.

Understanding CSS Gradients

A CSS gradient is a smooth transition between two or more colors, rendered by the browser as an image. Because it is generated rather than downloaded, a gradient background costs no extra HTTP request and scales perfectly to any size — which is why gradients replaced background images for most UI surfaces.

Gradient Syntax

Linear: background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%); — the angle sets the direction, then each color is paired with a position along that line.

Radial: background: radial-gradient(circle at center, #f9d423 0%, #ff4e50 100%); — colors radiate outward from a center point you choose.

Understanding the Angle

In CSS, gradient angles point toward where the gradient ends. 0deg runs bottom to top, 90deg runs left to right, 180deg runs top to bottom, and 270deg runs right to left. The widely used 135deg creates the diagonal top-left to bottom-right blend seen across modern web design.

Tips for Better Gradients

Gradients look best when the colors sit close together on the color wheel — wildly different hues tend to pass through a muddy grey in the middle. Keeping saturation and brightness roughly consistent across stops avoids visible banding. For text placed over a gradient, always check contrast against the lightest part of the gradient, not just the average.

Gradient Text Effect

To apply a gradient to text rather than a box, set the gradient as the element's background, then add background-clip: text, -webkit-background-clip: text, and color: transparent. The gradient then shows through the letterforms.

Frequently Asked Questions

How do I create a CSS gradient?

Choose linear or radial, pick your colors and their positions, adjust the angle, then copy the generated CSS and paste it as the background property of any element.

What is the difference between linear and radial gradients?

A linear gradient blends colors along a straight line in a direction you set with an angle. A radial gradient blends outward from a center point in a circle or ellipse, which is useful for spotlight and glow effects.

What does the angle in a linear gradient mean?

The angle sets the direction the gradient travels. 0deg goes bottom to top, 90deg goes left to right, 180deg goes top to bottom, and 270deg goes right to left. 135deg produces the popular diagonal top-left to bottom-right blend.

Do CSS gradients work in all browsers?

Yes. Unprefixed linear-gradient and radial-gradient are supported by every modern browser, including Chrome, Firefox, Safari and Edge. Vendor prefixes have not been necessary for many years.

Can I use a gradient on text?

Yes, by applying the gradient as a background and then clipping it to the text with background-clip: text and a transparent text color. This is a common technique for gradient headings.