Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to remove italic effect <i> tag using CSS?

Tags:

html

css

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.

like image 423
O-mkar Avatar asked Nov 29 '14 14:11

O-mkar


People also ask

How do you change italic text back to normal in HTML?

Use font-style to reset the italic style when the class is used.

How do you change italics in CSS?

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.

What is italic tag in CSS?

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.”


2 Answers

You just need to use this CSS code:

.no-italics {     font-style: normal;    } 

HTML code:

<span>    test    <i class='no-italics'>test</i> </span> 
like image 164
Winner Crespo Avatar answered Sep 20 '22 20:09

Winner Crespo


Use font-style:

i {   font-style: normal; } 
like image 36
Bhojendra Rauniyar Avatar answered Sep 22 '22 20:09

Bhojendra Rauniyar