totn HTML

HTML: <i> tag

This HTML tutorial explains how to use the HTML element called the <i> tag with syntax and examples.

Description

The HTML <i> tag merely gives text an italicized appearance but does not provide any semantic meaning to the text. This tag is also commonly referred to as the <i> element.

TIP: The HTML <i> tag should not be confused with the <em> tag which marks text that has stress emphasis.

Syntax

In HTML, the syntax for the <i> tag is:

<body>
<p><i>Italicized text goes here</i> but not here</p>
</body>

Sample Output


Attributes

Only the Global Attributes apply to the <i> tag. There are no attributes that are specific to the <i> tag.

Note

  • The HTML <i> element is found within the <body> tag.
  • The <i> tag is used to italicize text but does not put emphasis on the text like the <em tag> does.
  • In most cases, it is recommended that you use the <em> tag rather than the <i> tag.

Browser Compatibility

The <i> tag has basic support with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the <i> tag below, exploring examples of how to use the <i> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.