ComparisonComparisons

<em> vs <i>

<em> is stress that changes the meaning of a sentence when read aloud. <i> marks a different tone: foreign words, names or thoughts, without changing meaning.

On this page

Side-by-side comparison

#
  • Meaning

    <em>
    Stress that changes the meaning of a sentence when read aloud
    <i>
    A different tone: foreign words, names, a character’s thoughts
  • Default style

    <em>
    Italic
    <i>
    Italic, identical to em
  • Changes the meaning of the sentence

    <em>
    Yes
    <i>
    No
  • Can be nested for stronger emphasis

    <em>
    Yes
    <i>
    There’s no such convention
  • Typical example

    <em>
    "I didn’t delete that file"
    <i>
    <i lang="la">Panthera leo</i>

Example

#
HTML
<p><em>I</em> didn't delete that file. Maybe someone else did?</p>
<p>The field guide lists the lion by its scientific name, <i lang="la">Panthera leo</i>.</p>
Preview

Definition and usage

#

<em> marks stress, meaning a word spoken with emphasis that changes the meaning of the whole sentence. "I didn’t delete that file" suggests someone else did it, and stressing a different word in the same sentence would change the meaning completely. <em> elements can be nested for even stronger emphasis.

<i> doesn’t add stress and doesn’t change the meaning of the sentence. It marks a piece of text in a different tone: a foreign expression, a Latin species name, a technical term, or a character’s thoughts. Give a foreign-language species name a lang attribute, e.g. <i lang="la">Panthera leo</i>.

Browsers display both elements in italics, so they’re indistinguishable by eye. The difference is purely about meaning. If you want italics alone with no meaning behind them, for example in an image caption, use CSS: font-style: italic.

Syntax

#
Syntax
<em>stressed text</em>
<i>text in a different tone</i>

More examples

#
Stress in different places changes the meaning
HTML
<p><em>I</em> didn't report that bug. Maybe someone else reported it?</p>
<p>I didn't report <em>that</em> bug. I reported a completely different one.</p>
Preview
Italics with no meaning is a job for CSS
HTML
<p style="font-style: italic;">Text in italics just for looks, with no special meaning.</p>
Preview

Good practices

#
  • If a piece of text changes the meaning of what’s said when read aloud, use <em>.
  • Mark foreign expressions inside <i> with a lang attribute too, e.g. lang="fr".
  • Plain italics with no meaning is a job for CSS: font-style: italic.

Related entries

#

Spotted a mistake or missing an example? Write to us.