Home > Blockchain >  How can i do gradient-color to <i> tag?
How can i do gradient-color to <i> tag?

Time:11-13

how can I add a gradient color to <i> tag? i can to do background color with linear-gradient, but it works for background

i want to get gradient for filling;

.my_div i {
  background: linear-gradient (bla-bla-bla)
}
.my_div {
  color: *something*
}

but linear-gradient does not work for color-option

thanks in advance for help

CodePudding user response:

The <i> tag is an inline tag for italic text, if you want to add a color gradient to it, you can use this trick that requires webkit:

i {
  background: linear-gradient(to right, #0000ff, #ff0000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

The result looks like this.

  •  Tags:  
  • css
  • Related