+ 2
What is the meaning of the <em> text tag
I was wondering if something could explain to me the meaning of the em text tag?
9 Answers
+ 3
From the HTML living standard: <i> is "text in an alternate voice or mood", <em> is for emphasis.
The important thing to realize is that neither element should be used for making text in italics, that's what font-style in CSS is for. You should be using the tags for their meaning.
Historically (before people used CSS), they made the <i> tag for text in italics; but since we have moved all design things to CSS, the <i> tag lost it's meaning and they had to make one up in newer HTML versions. "text in an alternate mood" doesn't mean a whole lot if you think about it. That means usually you will want to use <em> and you'll be fine.
+ 2
It means emphasize, makes the text in this tag emphasized.
+ 2
<i> and <em> both italicize/emphasize text. However they can serve different purposes. For example, if you want to build an email template you might want to keep in mind that some email clients won't interpret <em> in an html email but it may interpret <i>.
+ 2
What Schindlabua posted is absolutely correct too. I gave email templates as an example because of how finicky they are. If speaking strictly from a web development standpoint then yes, use css.
+ 1
In the example I provided I mentioned email clients. Gmail, Outlook, Yahoo and any other email app (email client) may or may not interpret <i> or <em> ... in other words, they might not render the desired effect you would expect. Just requires testing to figure that out for yourself. But both tags do essentially the same thing.
+ 1
I had to design a semi-complicated HTML email once and it ended up looking different in every mail client. It's like every mail client implements half a browser and every single one is terrible and outdated :D That must be how webdev in the early 2000s was all the time...
God bless the HTML living standard but yeah <em> is definitely too modern for e-mail :D
+ 1
hahaha! Yep I totally get it. I often have the displeasure of working with and building customized email templates. I wish they'd standardize this already!
+ 1
<em> tag does the same thing what <i> tag does. 'em' means emphasis.
As the current version of HTML is HTML 5. In this instead of <i> we use <em>
I hope I made it clear. Use it by yourself and your all doubts will get cleared.
0
What exactly do you mean Michael? interpret i instead of em? is there a case in which one is preferable to use over the other?