What is HTML Italic Element?
In HTML, <i>
(italic) element is used to display text in italic style in a webpage.
The italic element is purely presentational; it doesn't carry any specific semantic meaning on its own.
Example of Creating HTML Italic Text
Create an HTML <i>
element in a <p>
element.
Place the text 'an example of HTML italic text.' between the <i>
and </i>
tags as shown in the following example.
The text will be displayed in italic style in the output.
Example of HTML Italic Element
Output of the above example
Example of Italic Text
This is an example of HTML italic text.
<i> tag is used to display bold text
What is HTML Emphsis Element?
In HTML, <em>
(strong) element is used to apply italic style with emphasis in related to the meaning of the text.
The emphasis element also indicates that the enclosed text is of importance from a semantic standpoint.
It is best practice to use the <em>
element instead of <i>
when the emphasis is related to the meaning of the text.
In the following example, the text 'consectetur adipiscing elit.' is enclosed with <em>
element tag. The text will be display in italic style in the output.