W3docs

HTML <i> Tag

Use HTML <i> tag define a part of the text in a different voice. The text placed within the <i> tag is usually displayed in italic. See examples.

The <i> tag is used to define a part of the text in a different voice. The text placed within the <i> tag is usually displayed in italic. This tag is used to define technical terms, phrases from foreign languages, etc.

In HTML5, the <i> tag is a semantic element used to represent text in an alternate voice or mood, rather than a purely presentational one. This means the content carries specific meaning for browsers and search engines, even though it is typically rendered in italic by default. If you only need italic styling without the semantic meaning, it’s better to use the CSS font-style property instead of the <i> tag.

Sometimes you may need to use other, more appropriate elements:

Tip

If you want to highlight an important text, then use the semantic markup tag <em> instead of the <i> tag.

Syntax

The <i> tag comes in pairs. The content is written between the opening (<i>) and closing (</i>) tags.

Example of the HTML <i> tag:

HTML <i> Tag

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <p>Before the end of the week <i>it is vital to</i> finish all the work.</p>
  </body>
</html>

Result

italic text example

Attributes

The <i> tag supports the Global Attributes and Event Attributes.

How to style an HTML <i> Tag

<style>
  .custom-italic {
    font-style: italic;
  }
</style>
<p>Before the end of the week <span class="custom-italic">it is vital to</span> finish all the work.</p>

Practice

Practice

What does the <i> tag in HTML represent?