34

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?
user3232227
  • 349
  • 1
  • 3
  • 4
  • 4
    "Newer"? Both appeared in HTML 2, which is almost twenty years old. – Quentin Jan 24 '14 at 13:50
  • 1
    Does anyone still care about palm pilots? :) – Sergio Tulentsev Jan 24 '14 at 13:51
  • There's an argument to say you shouldn't use either anymore. CSS should dictate what the style is not HTML. – Liam Jan 24 '14 at 13:51
  • I was told it was newer to use the < em > vs the < i >-and I did not argue, but accepted that was why there were two that seemed to do the same, and why the first time I studied html no mention was made of < em > in any place I looked it up, but now you have that given as the default. Idk if anyone cares about palm pilots, again, when I was researching the difference between the "old" and "new" ways of coding for bold or strong and italics, the example was given that if your reader was using a device that already bolded all text (such as a palm pilot) the bold tag would be useless, whereas... – user3232227 Jan 24 '14 at 16:44
  • ...whereas the strong tag would have meaning, and the device would underline that text. I simply wondered what would happen in similar scenario if the italic tag was used, what difference could it make? – user3232227 Jan 24 '14 at 16:44
  • I have read your answers and the answers below to what you are saying are duplicate questions, but I cannot find the answer to what I asked, so I went back and added to my original question in an attempt to clarify what I want to know, because it does not appear to me to be a duplicate or answered anywhere here. – user3232227 Jan 24 '14 at 16:54
  • A screen reader will pronounce the words in with an emphasis, using verbal stress. – Lexus de Vinco Jun 21 '22 at 23:59

2 Answers2

30

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.

Joe Flynn
  • 6,908
  • 6
  • 31
  • 44
  • 3
    `` is commonly used for icons these days e.g.[https://fontawesome.com/](https://fontawesome.com/) I personally use `` for icons and `` for italic – Paul C Jan 30 '20 at 11:42
20

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.

deceze
  • 510,633
  • 85
  • 743
  • 889
  • 2
    They have not been deprecated. – Joe Flynn Jan 24 '14 at 13:56
  • You are right. I seem to misremember. Or has it been undeprecated at some point? – deceze Jan 24 '14 at 13:58
  • 1
    [WHATWG - Why are some presentational elements like b, i and small still included?](http://wiki.whatwg.org/wiki/FAQ#Why%5Fare%5Fsome%5Fpresentational%5Felements%5Flike%5F.3Cb.3E.2C%5F.3Ci.3E%5Fand%5F.3Csmall.3E%5Fstill%5Fincluded.3F) – Joe Flynn Jan 24 '14 at 14:00
  • 3
    Updated address of the FAQ in the comment above: https://github.com/whatwg/html/blob/master/FAQ.md#why-are-some-presentational-elements-like-b-i-and-small-still-included – tuomassalo Sep 27 '18 at 09:31
  • A screen reader will pronounce the words in with an emphasis, using verbal stress. – Lexus de Vinco Jun 21 '22 at 23:58