Skip to content
Related Articles

Related Articles

HTML <i> Tag
  • Difficulty Level : Basic
  • Last Updated : 03 Feb, 2021

The <i> tag in HTML is used to display the content in italic style. This tag is generally used to display the technical term, phrase, important word in a different language.

Syntax :

<i> Contents... </i>

Below programs illustrate the <i> tag in HTML:

Example 1:




<!DOCTYPE html>
<html>
  
<head>
    <title>Italic Tag</title>
    <style>
        body {
            text-align: center;
        }
          
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h2>Let's check some examples:</h2>
    <p>This is normal text written inside p tag</p>
    <p><i>This text is in italic font style</i></p>
</body>
  
</html>                                       

Output:



Example 2: A text can be written in italics using CSS also. When the CSS font-style property is equal to italic, then the text can be seen as follows:




<!DOCTYPE html>
<html>
  
<head>
    <title>Italic Tag</title>
    <style>
        body {
            text-align: center;
        }
          
        p {
            font-style: italic;
        }
          
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h2>Let's see an example of font-style: italic</h2>
    <p>This text content is in italic font.</p>
    <h5>Note:This example is only possible when the
     font-style property is kept "italic" in CSS</h5>
  
</body>
  
</html>                    

Output:

Usage:

  • Use the <i> tag for words that you want to show differently from the normal phrase for readability purposes
  • The tags like <i> and <b> now define semantics rather than typographic appearance. So to display text in italic type, users can use the CSS font-style property.
  • Use <i> tag only when it is not marked up with these elements:

    Supported Browser:

    • Google Chrome
    • Internet Explorer
    • Firefox
    • Opera
    • Safari
    My Personal Notes arrow_drop_up
Recommended Articles
Page :