How do I remove italic effect of <i>
tag so I can do this:
<span> test<i>test</i> </span>
I am filling some text in the <i>
tag using jQuery innerHtml, so it comes in italic, but I don't want the italic effect.
Is there any way I can remove the italic effect using CSS?
I cant use a different tag. I can only use the <i>
tag.
Use font-style to reset the italic style when the class is used.
Use the <em> tag. The “em” in <em> literally stands for emphasis. Browsers will, by default, make italicize text that is wrapped in HTML <em> tags. Imagine the sound of that sentence, where the reader is emphasizing that word giving the sentence a different feel that if they didn't.
To italicize the text in HTML, use either the em tag or the i (italics) tag. Both of these tags will italicize the text, but the em tag additionally indicates that the text has stress emphasis when read. You can also italicize text with the CSS font-style property set to “italic.”
You just need to use this CSS code:
.no-italics { font-style: normal; }
HTML code:
<span> test <i class='no-italics'>test</i> </span>
Use font-style:
i { font-style: normal; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With