Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

thanks in advance for help

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading