demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

Italicizing and Bolding Text

HTML is designed to be as independent of medium and client as possible. While you and I interact with the majority of web pages visually via a computer screen, there are numerous other possibilities for how the content may be shown, such as print, text-to-speech readers, braille translators, and more.

For this reason, tags that format text in HTML are as broadly applicable as possible. <em>, for instance, emphasizes text. In most cases, visually rendered <em> content means it is italicized, but a text-to-speech tool will emphasize the text verbally, just as you would reading the text out loud.

<strong>, visually, bolds the content between the opening and closing <strong> tags, but again, the tag will have different meanings in different contexts.

Both tags are intended to be used on a short portion of text – a word or two, perhaps a sentence in a paragraph that is several sentences long. If you find yourself coding this:

  1. <p><em> .. lots of content here .. </em></p>

… it is almost always a sign that you should not be using <em> or <strong> but CSS instead.

Similarly, <strong> makes little to no difference inside of heading elements. Use CSS instead.

reintroduces the <b> and <em> tags, but I would recommend sticking with strong and em, as the former have greater applicability and accessibility.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.