HTML - <i> Tag



HTML <i> tag is used to display the content in italic style is generally used for the important words in the different languages and also for the technical terms. If we are writing content within a paragraph element but an important word or different language comes in the content, we can use the <i> tag to highlight the important word.

Syntax

<i> content </i>

Attribute

HTML i tag supports Global and Event attributes of HTML.

Examples of HTML i Tag

In the bellow examples we will see the different examples of i elements. Each example will illustrate the use cases of html i tag.

Specifying italic Element

In this following example, let’s see the usage of <i> tag how it will work in the HTML document.

<!DOCTYPE html>
<html>
<body>
   <h2>
      <i>This one is italic text</i>
   </h2>
   <p>
      I looked at it and thought 
      <i>This can't be real! </i>
   </p>
   <p>
      The term <i>bandwidth</i> describes the measure
      of how much information can pass through a data connection 
      in a given amount of time.
   </p>
</body>
</html>

Styling italic Element

Considering the following example, where we are creating an HTML document and using the <i> tag to create italic text and also using the style properties to make the italic text stylish.

<!DOCTYPE html>
<html>
<head>
   <style>
      i {
      color: red;
      }
   </style>
</head>
<body>
   <h2>
      <i>This one is italic text</i>
   </h2>
   <p>
      I looked at it and thought 
      <i>This can't be real! </i>
   </p>
   <p>
      The term <i>bandwidth</i> describes the measure
      of how much information can pass through a data connection 
      in a given amount of time.
   </p>
</body>
</html>

Idicating diff language with Italic Element

Let's look into the another scenario, where we are going to use the <i> in text to indicate that is of different language.

<!DOCTYPE html>
<html>
<head>
   <style>
      i {
      color: red;
      }
   </style>
</head>
<body>
   <p>
      The Latin phrase <i lang="la">Veni, vidi, 
      vici</i> is often mentioned in music, art, 
      and literature. 
   </p>
</body>
</html>

HTML <i> Tag Usage

Use the <i> tag on any text when there are no more appropriate semantic element. Such as <em>, <strong>, <mark>, <cite>, and <dfn> tags.

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
i Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements