7

Is it possible to set horizontal gradient to text via CSS? (left letter one colour, right - another colour).

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Roman Gryndii
  • 89
  • 1
  • 1
  • 6

1 Answers1

22

Yes, it is.

h1 {
  font-size: 72px;
   background: -webkit-linear-gradient(left, red , yellow);
   background: -o-linear-gradient(right, red, yellow);
   background: -moz-linear-gradient(right, red, yellow);
   background: linear-gradient(to right, red , yellow); 
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
<h1>Hello World</h1>
kind user
  • 40,029
  • 7
  • 67
  • 77