Pre-HTML5, there was no difference, neither in visuals nor semantics; i
, like b
, s
and u
, was a presentational element. This is in contrast to em
, strong
, del
and ins
respectively.
In HTML5, the i
element has a specific meaning that happens to be represented visually as italicized text. It should not be used to represent just any text that happens to be in italics. In particular, it distinguishes itself from the em
element, which represents stress emphasis (and, unlike i
, doesn't necessarily have to be represented with italics). span
remains a generic phrasing element that carries no meaning whatsoever.
Normally I would quote the spec here but I think MDN's summary is easier to understand:
The HTML <i>
element represents a range of text that is set off from the normal text for some reason. Some examples include technical terms, foreign language phrases, or fictional character thoughts. It is typically displayed in italic type.
The spec still offers better examples though:
The examples below show uses of the i
element:
<p>The <i class="taxonomy">Felis silvestris catus</i> is cute.</p>
<p>The term <i>prose content</i> is defined above.</p>
<p>There is a certain <i lang="fr">je ne sais quoi</i> in the air.</p>
In the following example, a dream sequence is marked up using i
elements.
<p>Raymond tried to sleep.</p>
<p><i>The ship sailed away on Thursday</i>, he
dreamt. <i>The ship had many people aboard, including a beautiful
princess called Carey. He watched her, day-in, day-out, hoping she
would notice him, but she never did.</i></p>
<p><i>Finally one night he picked up the courage to speak with
her—</i></p>
<p>Raymond woke with a start as the fire alarm rang out.</p>