SyntaxStudy
Sign Up
CSS Intermediate 4 min read

Gradient Text

Gradient Text

Apply a gradient to text by setting background-clip: text and making the color transparent.

Example
.gradient-text {
  background: linear-gradient(90deg, #f9a825, #e53935);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900; font-size: 3rem;
}
Pro Tip

Always provide a fallback color for browsers that do not support background-clip: text.