One question I see around the interwebs a lot is why
em should be used over
i. If we look at the HTML 4 spec, it lists
i under the Font style section, and notes:
The following HTML elements specify font information. Although they are not all deprecated, their use is discouraged in favor of style sheets.
em tags are listed under the Phrase elements section and note:
Phrase elements add structural information to text fragments.
Now that’s all well and good, but what does it mean?
Among other things:
b and i are visual.
What this means is that in a web browser, when the html parser encounters a
<b> tag, it knows to bold the font. It’s a physical property, meaning “use thicker ink when displaying this word.” Same with
<i> – “skew this so it looks like it’s going really fast” (or something like that). These are tags whose sole purpose is to physically change the display of the text.
Well, maybe not. What about when a blind person views a page? The visual properties mean nothing to them. That’s where
strong come in.
em and strong are semantic
em tag indicates emphasis and the
strong tag indicates stronger emphasis. This could (and usually does) mean italics and bold on a web page. But it also could alert a text-to-speech program to use a different tone of voice when encountering the text. They have meaning behind them, and that meaning means different things to different interpreters.
As noted by the HTML 4 spec,
i, although not deprecated, should be avoided because not only are they style properties that should be handled in CSS, they don’t have any semantic meaning. Use
em in their place.