Gradient Text
Generated CSS

CSS Gradient Text Generator

CSS gradient text uses the background-clip: text technique — you apply a gradient as the element's background, then clip it to the text shape. This makes the gradient appear only where the text characters are, with the background showing through everywhere else.

Use the generator above to pick colors, set angle and gradient type — then copy the CSS directly into your project.

How CSS Gradient Text Works

.gradient-text {
  background: linear-gradient(90deg, #7c6fff, #ff6fb0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* fallback */
}

Browser Support

PropertyChromeFirefoxSafariEdge
background-clip: textYesYesYes (-webkit)Yes
-webkit-text-fill-colorYesYesYesYes

Frequently Asked Questions

Why is -webkit-background-clip still needed?

Safari requires the -webkit- prefix. While background-clip: text is now in the standard, keeping both ensures maximum browser compatibility.

Does gradient text work on buttons?

Yes — apply the same CSS to any inline or block element. For <button> elements, set background on the button itself and -webkit-background-clip: text. Make sure no other background overrides it.

Why does my gradient text disappear on a dark background?

The element background shows through the transparent text. If your parent element has the same gradient background, the text appears to disappear. Use a contrasting parent background or add a text-shadow fallback.

Related tools: CSS Gradient Generator · Neon Text Generator · Text Shadow Generator

Tool last updated: