![]() |
VOOZH | about |
The <i> tag in HTML displays text in an italic style and is mainly used for words or phrases that need a different visual meaning. It often highlights technical terms or foreign words.
Syntax:
// Inline way to make italic text in html file
<i> Now content is Italic </i>
// Use in external style.css file to make italic
i {
font-style: italic;
}
Demonstrates how the <i> tag and CSS can be used to render text in italics.
Example 1: Illustrating the <i> tag to make the italic text in HTML.
Output:
Example 2: Using <i> tag & <p> tag to illustrate the difference in the text appearance while rendering it.
Output:
Example 3: A text can be written in italics using CSS also. When the CSS font-style property is set to italic, then the text can be seen as follows:
Output:
Defines when to use the <i> tag for stylistic text without adding semantic importance.
Note: The <i> tag is also supported by Global attribute and Event Attributes in HTML.