DEV Community

Atif Riaz
Atif Riaz

Posted on

Gradient Text

Gives text a gradient color.

HTML

<h1 class="gradient-text">Gradient text</h1>
Enter fullscreen mode Exit fullscreen mode

CSS

.gradient-text {
font-size: 100px;
  background: -webkit-linear-gradient(pink, red);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
}
Enter fullscreen mode Exit fullscreen mode

Demo

Top comments (0)