Roman Gryndii Roman Gryndii - 1 month ago 10
CSS Question

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

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

Answer

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>

Comments