Description

The HTML element <i> is used to format a text to its italic typeface.

It is commonly used to define a part of a text in an alternate voice or mood than the content around it.

Elements <i> and <em> are different.

  • Element <i> is used to simply format a text to italic.
  • Element <em> is used to emphasize a text to make it important in the context it is used, and it is displayed in italics.

The below table summarizes its usage.

Usage Details
Placement It is displayed as an Inline element.
Contents It can contain Inline elements and text.
Tags Both the opening and closing tags are required.
Versions HTML 2,3.2, 4, 4.01, 5

Syntax

Here is the basic syntax of the <i> element.

<i>...</i>

Examples

Element <i> used to insert a horizontal rule between two sections.

<p>This paragraph has an <i>italic</i> text.</p>

Attributes

The following table shows the list of supported and unsupported attributes for the <i> element.

Attribute Type Details
Element-Specific Attributes The tags <i> doesn't have any element-specific attributes.
Global Attributes Like all other HTML tags, the tag <i> supports the HTML Global Attributes.
Event Attributes The tags <i> also supports the HTML Event Attributes.

Browser Compatibility

The tags <i> is supported in all modern browsers.

  • Google Chrome 1+
  • Internet Explorer or Edge 2+
  • Firefox 1+
  • Apple Safari 1+
  • Opera 2.1+

Related Links