Choose the correct html tag to make a text italic

In this tutorial, we understand how to choose the correct HTML tag to make a text italic. The HTML tag is used to format the webpage.

 

Choose the correct html tag to make a text italic

 

Html tag to make a text italic

 

The <i> Html tag is used to make a text italic in HTML below is the format

<i></i>

Write the text in between the opening and closing of <i> which you want to be italic.

 

Example 1

How to make HTML text italic

<i>This text is italic</i>

Output

This text is italic

 

There is one alternate of <i> tag which is used to to make a text italic the <em> HTML tag. The <em> tag used to define emphasized text in HTML and the text inside the <em> tag will display as italic.

 

Example 2-

<em>This text is italic </em>

Output

This text is italic

Although the output of both the HTML tag is the same. It is recommended that you use <i> HTML tag instead <em> tag that is most popular.

Use of  <i> HTML tag

 

Sometimes we have the requirement that we need to highlight the text in a long paragraph either we highlight it using the bold <b> tag or if the requirement is something that we need to make italic. Then a certain portion of the paragraph we can make italic using <i> tag.

 

Example – 3

 

Suppose when below paragraph –

“Welcome to geekstutorials. This site is optimized to learn different technologies”

 

Now you want to make “geekstutorials.com” italic so use the <i> tag before the after the text.

 

<!DOCTYPE html>
 <html>
 <body>
  <h1>Welcome to geeks</h1>
  <p> Welcome to <i>geekstutorials</i>.This site is optimized to learn different technologies </p>
</body>
</html>

 

Conclusion

This is how you can make any text italic using these HTML tags. As said earlier the end result of both the tags are the same hence italic but there are some differences the <em> tag is used when you want to put more focus/stress on a word or phrase. <i> tag would be used when you don’t need to stress a word.