Programming

Emphasis and importance

The difference between em, strong, i and b.

All lessons · HTML lessons: learn from scratch

em and strong

<em> adds stress of meaning (the intonation changes when read aloud) and <strong> signals that the text is important. Browsers usually show em in italics and strong in bold, but the choice should follow meaning, not looks.

<p>I <em>really</em> want this.</p>
<p><strong>Warning:</strong> do not unplug the device.</p>

i, b and u

<i>, <b> and <u> are for stylistic reasons: <i> for a foreign word or technical term, <b> for a keyword, <u> for a misspelling or a special annotation. For plain decoration use CSS.

<p>The word <i lang="la">habitat</i> comes from Latin.</p>
<p>Ingredients: <b>flour</b>, <b>eggs</b>, sugar.</p>

Other useful elements

  • <mark> highlights text.
  • <small> is for fine print.
  • <sub> and <sup> are subscript and superscript: H<sub>2</sub>O, m<sup>2</sup>.
  • <abbr title="…"> reveals what an abbreviation stands for.
<p>Water is H<sub>2</sub>O and the room is 20 m<sup>2</sup>.</p>
<p><abbr title="HyperText Markup Language">HTML</abbr> is not a <mark>programming</mark> language.</p>

Author: Nibras Code