What is the meaning of the <em> text tag | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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?

8th Aug 2018, 7:21 PM
Brian de Groot
Brian de Groot - avatar
9 Réponses
+ 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.
8th Aug 2018, 11:01 PM
Schindlabua
Schindlabua - avatar
+ 2
It means emphasize, makes the text in this tag emphasized.
8th Aug 2018, 7:34 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 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>.
8th Aug 2018, 10:11 PM
Mike
Mike - avatar
+ 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.
8th Aug 2018, 11:21 PM
Mike
Mike - avatar
+ 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.
8th Aug 2018, 10:46 PM
Mike
Mike - avatar
+ 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
8th Aug 2018, 11:30 PM
Schindlabua
Schindlabua - avatar
+ 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!
8th Aug 2018, 11:33 PM
Mike
Mike - avatar
+ 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.
9th Aug 2018, 12:54 PM
Manish Kumar
Manish Kumar - avatar
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?
8th Aug 2018, 10:38 PM
Brian de Groot
Brian de Groot - avatar