HTML <i>
Tag
<i>
tag in HTML is used to italicize text. It is used to emphasize text or convey a different meaning to the reader.
Here is an example of how to use the <i>
tag:
<p>This is <i>italicized</i> text.</p>
When rendered in a web page, the text "italicized" will be displayed in italics.
Main attributes of the <i>
tag:
Attribute | Description |
---|---|
class |
Specifies a class name for the <i> tag for styling purposes. |
id |
Specifies a unique id for the <i> tag for JavaScript manipulation. |
style |
Specifies inline CSS styles for the <i> tag. |
Here is an example of using the <i>
tag with the class attribute:
<p>This is <i class="italic-text">italicized</i> text.</p>
In the above example, the text "italicized" will be displayed in italics with a specific style applied to it using the "italic-text" class.