HTML Text Formatting - Italic and Bold Text
Nov042010
Tags: HTML, Web Standards, XHTML
The other day as I was formatting some text for this website, I was thinking about how there are two different tags that can produce italic text. One is the <i> tag, and the other is the <em> tag. Wanting to know more, I did a little internet research. I discovered that while all major browsers currently render the <em> tag as italics, the <em> tag really only means that the text inside those tags should be formatted in some way that the reader will understand as being important. It doesn't have to be rendered as italics. What this means is that one day, a browser such as Internet Explorer could decide to render <em> text as cursive instead of italics, and all of the italic text on your site would then appear as cursive text in Internet Explorer.
Because the use of the <em> tag is so widespread, and people expect it to render italic text, it is unlikely that a major browser such as IE would choose to change how the <em> tag formats text. It is nonetheless, still a possibility, and a reason to use the <i> tag instead, if only to be safe.
The same thing goes for the <strong> tag. The <strong> tag currently renders text as bold in all of the major browsers, but <strong> only signifies that the text is important, just like the <em> tag. To be safe, use the <b> tag to render text as bold.

Comments
Post new comment