Asked • 03/27/19

What's the difference between and <strong>, <i> and <em>?

What's the difference between `` and ``, `` and `` in HTML/XHTML? When should you use each?

1 Expert Answer

By:

Ian M. answered • 03/27/19

Tutor
5.0 (2,509)

Professional Web Designer, Developer, UI/UX

Lee M.

tutor
A month ago I would have read this answer and totally agreed (and wished I could write as clearly as Ian does). But I recently came across a discussion of the new semantic meaning of the b and i elements in the HTML 5 spec. In short they are used to "draw the reader's attention to the element's contents, which are not otherwise granted special importance." (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b and https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i for a more detailed discussion) They note that these tags should not be used merely for styling but to convey the meaning that the text inside the element should be given special attention. Examples they provide for <b> are "keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special importance). Examples they provide for <i> are "...technical terms, foreign language phrases, or fictional character thoughts." Typically we would have marked up these types of things by wrapping the text in a span tag (which carries no semantic meaning). I'm guessing that the thought process was that these tags are shorter, and part of the spec so why not make them useful.
Report

04/01/19

Ian M.

Lee, well spotted! Although I'll point out that in the same MDN article you referenced, it suggested "the <b> element doesn't convey such special semantic information; use it only when no others fit." To me, this implies a backward justification for the legacy and unsemantic <b> element. (Same goes for <i>.) Its use is not (yet) deprecated, but as a last-resort HTML tag, it's about as close as it can get.
Report

04/11/19

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.