CSS Generators

CSS Text Gradient

All tools

Fill a headline with a two-color gradient and copy the four lines that make it work.

How it works

Four simple steps

1

Set the start color

Type any CSS color in the From field.

2

Set the end color

Type the color the text should fade into.

3

Check the heading

The sample text shows the gradient clipped to the letters.

4

Copy all four lines

Copy the background, clip and color rules together.

CSS Text Gradient

About CSS Text Gradient

The landing page hero needs a heading that fades from brand blue to teal. The trick involves a background, a clip, a prefixed property and transparent text color, and forgetting any one of them leaves you with a colored rectangle. Choose the two colors and copy the complete set.

Enter a start color and an end color. Both fields accept any CSS color, so hex values, rgb(), hsl() and named colors work. The sample heading updates as you type. The output contains four declarations: a linear-gradient at 90 degrees on background, -webkit-background-clip: text, background-clip: text and color: transparent. Together they paint the gradient inside the letter shapes only.

Keep the prefixed line; WebKit-based browsers still rely on it for text clipping. Also keep the element inline-block or limit its width if the heading is short, because the gradient stretches across the full element box and a narrow word in a wide block shows only the first color. If you change the angle in the copied value, use something like 135deg for a diagonal blend. Gradient text can be hard to read where the colors are light, so check both ends with the WCAG contrast checker. For gradients with more stops or radial shapes, build the background in the gradient generator and paste it in place of the linear-gradient here.

The preview is rendered with the same CSS the tool outputs.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

color is set to transparent, so if the background or background-clip line is missing or overridden, nothing is painted. Check that all four lines reached the element and that no other rule resets background.

The tool always writes 90deg (left to right). Edit the angle in the copied linear-gradient, for example 180deg for top to bottom.

Yes. The text is still real text, so it can be selected, copied and read by screen readers. Only the painting changes.

View more FAQs

Related tools

View all

Tailwind Class Sorter

Sort Tailwind classes and detect conflicting utilities with a winner explanation.

Open

Design System Diff Lab

Diff design tokens and inspect CSS @layer order and selector specificity locally.

Open

SVG Path Inspector

Parse SVG path commands, preview on canvas, round and minify coordinates.

Open

Flexbox Generator

Build flex layouts visually.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools