Inline
HTML 2.0
The idiomatic text element represents text in an alternate voice or mood, or otherwise offset from normal prose. It’s typically rendered in italic but has semantic meaning beyond visual styling.
Interactive code playground requires JavaScript. Here's the code:
<p>The term <i>semantic HTML</i> refers to meaningful markup.</p>
<p>She thought, <i>What a beautiful day!</i></p>
< i > text in alternate voice </ i >
The <i> element is for text that’s set off from normal prose for specific semantic reasons.
A critical distinction in HTML:
<!-- Alternate voice/mood, no stress emphasis -->
< p > The word < i > semantics </ i > comes from Greek. </ p >
< p > The ship < i > HMS Beagle </ i > sailed in 1831. </ p >
Use <i> for stylistic offset without emphasis.
<!-- Stress emphasis that changes meaning -->
< p > I < em > really </ em > need this done today. </ p >
< p > You should < em > always </ em > save your work. </ p >
Use <em> for stress emphasis when speaking.
Interactive code playground requires JavaScript. Here's the code:
<p>In programming, the term <i>variable</i> refers to a storage location.</p>
<p>The <i>DOM</i> represents the structure of a web page.</p>
Interactive code playground requires JavaScript. Here's the code:
<p>The French phrase <i lang="fr">c'est la vie</i> means "that's life."</p>
<p>He said <i lang="es">¡Hola!</i> when he entered.</p>
Interactive code playground requires JavaScript. Here's the code:
<p>The scientific name for humans is <i>Homo sapiens</i>.</p>
<p>The <i>Panthera leo</i> (lion) is a carnivorous mammal.</p>
Interactive code playground requires JavaScript. Here's the code:
<p>The <i>RMS Titanic</i> sank in 1912.</p>
<p>The spacecraft <i>Voyager 1</i> has left the solar system.</p>
Interactive code playground requires JavaScript. Here's the code:
<p>She looked at the sky and thought, <i>It's going to rain.</i></p>
<p>He wondered, <i>Should I say something?</i></p>
Interactive code playground requires JavaScript. Here's the code:
<p>In the dream, he heard a voice saying, <i>Follow the white rabbit.</i></p>
Interactive code playground requires JavaScript. Here's the code:
<p>The narrator continued: <i>And so the adventure began...</i></p>
When introducing an idiom or phrase being discussed:
Interactive code playground requires JavaScript. Here's the code:
<p>The expression <i>break a leg</i> means "good luck" in theater.</p>
<p>The phrase <i>raining cats and dogs</i> means heavy rain.</p>
Always use lang attribute for foreign text:
Interactive code playground requires JavaScript. Here's the code:
<p>She greeted me with <i lang="ja">こんにちは</i> (hello in Japanese).</p>
<p>The German word <i lang="de">Schadenfreude</i> has no direct English translation.</p>
Customize the appearance:
Interactive code playground requires JavaScript. Here's the code:
<style>
i {
font-style: italic;
color: #666;
}
i[lang] {
color: #0066cc;
}
i[lang]:hover::after {
content: ' [' attr(lang) ']';
font-size: 0.8em;
}
</style>
<p>The word <i lang="fr">bonjour</i> means hello.</p>
< p > This is < i > very important </ i > . </ p >
< p > This is < em > very important </ em > . </ p >
< p > I'm reading < i > To Kill a Mockingbird </ i > . </ p >
< p > I'm reading < cite > To Kill a Mockingbird </ cite > . </ p >
< p >< i > Welcome to our site </ i ></ p >
< p class = " welcome " > Welcome to our site </ p >
The <i> element is commonly used for icon fonts (though this is not semantic):
Interactive code playground requires JavaScript. Here's the code:
<style>
/* Simulating icon font behavior */
.icon-star::before { content: '⭐ '; }
.icon-heart::before { content: '❤️ '; }
</style>
<p><i class="icon-star"></i>Favorite</p>
<p><i class="icon-heart"></i>Like</p>
Interactive code playground requires JavaScript. Here's the code:
<article>
<p>The concept of <i>responsive design</i> revolutionized web development. As Ethan Marcotte coined the term, designers began thinking about fluid layouts.</p>
<p>He thought to himself, <i>This changes everything.</i></p>
</article>
Interactive code playground requires JavaScript. Here's the code:
<p>Recent studies of <i>Escherichia coli</i> (E. coli) have revealed new insights into bacterial resistance.</p>
Interactive code playground requires JavaScript. Here's the code:
<p>Our new <i>premium</i> tier includes advanced features. Think of it as the <i lang="fr">crème de la crème</i> of our offerings.</p>
Element Use Case Example <i>Alternate voice/mood <i>foreign word</i><em>Stress emphasis <em>really</em> important<b>Keywords, no importance <b>Product name</b><strong>Strong importance <strong>Warning:</strong><cite>Titles of works <cite>Book Title</cite><dfn>Defining instance <dfn>term</dfn>
Screen readers typically don’t announce <i> differently, but the visual distinction helps sighted users.
Always specify language for foreign text:
<!-- Good: helps screen readers pronounce correctly -->
<!-- Poor: screen reader may mispronounce -->
If using <i> for icons, provide text alternatives:
<!-- With visible text -->
< button >< i class = " icon-save " ></ i > Save </ button >
<!-- Icon only: add aria-label -->
< button aria-label = " Save " >< i class = " icon-save " ></ i ></ button >
Browser Version Notes Chrome 1+ Full support Firefox 1+ Full support Safari 1+ Full support Edge 12+ Full support IE 3+ Full support
The <i> element has been supported since the earliest browsers.