Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the benefit of <em> vs <i>? [duplicate]

Tags:

html

I have heard that using the newer <strong> tag as opposed to <b> creates an ability for some devices to make text "strong" that was already bolded-as in the case of a palm pilot, where it would be underlined if you used <strong>.

I have also heard that older browsers cannot recognize <strong> and <em> and just ignore them, but newer browsers recognize both the old and new tags, making it an advantage to use the older tags if your users/viewers might have old browsers-however some newer devices benefit from the newer tag (like the <strong> vs <b>).

So I was wondering-how does the <em> tag show up on, say, a palm pilot, or similar devices?

What is the advantage and disadvantage of using <em> vs <i>? Or vice-versa?

~Added after comments and marked as "duplicate"~

Since this seems to some to be a duplicate question, but I can't find my answer, I will rephrase:

  1. What would happen to text in a browser that did not recognize the < i > tag if you used that instead of the < em > tag? How would it appear?
  2. Is there any advantage to using the < i > tag that now appears to be less "correct" to use then the < em > tag? For instance-some devices might recognize it but not the other? Or would it be pretty much obsolete and useless?
like image 864
user3232227 Avatar asked Jan 24 '14 13:01

user3232227


People also ask

Is it better to use I or em?

i has the purpose of presenting something in italicised style. em has the purpose of giving emphasis to the content. In practice emphasised content is typically displayed italicised, so the difference on the face of it is non-existing from a presentation standpoint.

What is difference between em and I?

The main difference between these two tag is that the <em> tag semantically emphasizes on the important word or section of words while <i> tag is just offset text conventionally styled in italic to show alternative mood or voice.

What's the difference between B and strong I and em >?

b or i means you want the text to be rendered as bold or italics. strong or em means you want the text to be rendered in a way that the user understands as "important".

Why do we use em tag?

Definition and Usage The <em> tag is used to define emphasized text. The content inside is typically displayed in italic. A screen reader will pronounce the words in <em> with an emphasis, using verbal stress.


2 Answers

It's about semantics. Using strong or em means that the contents of the tag have more emphasis than the nearby copy.

Bolding or italicizing stuff is just formatting. And formatting belongs in css, not html.

like image 86
Joe Flynn Avatar answered Oct 12 '22 17:10

Joe Flynn


The purpose of HTML is to mark up text semantically, meaning to give it meaning. This is explicitly separate from presentation, which is to be handled by CSS.

i has the purpose of presenting something in italicised style.
em has the purpose of giving emphasis to the content.

In practice emphasised content is typically displayed italicised, so the difference on the face of it is non-existing from a presentation standpoint. However, emphasis is semantic while italics is presentation. i was deprecated in favour of em to make HTML a truly semantic markup. It may seem like nitpicking, but at least it's thorough.

like image 20
deceze Avatar answered Oct 12 '22 18:10

deceze