Skip to content
Related Articles

Related Articles

What are various tags available to add special meaning to the text in HTML ?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 02 Feb, 2022

In this article, we will discuss the tags that will add special meaning to the text in HTML.

HTML <b> and <strong> Tags: Both tags are used to make the text bold. The text content of the tag is shown as important information on the webpage.

Syntax:

<b> ... </b>
<strong> ... </strong>

Example: Using the code below, this example will demonstrate how to use the <b> and <strong> tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Bold and strong</title>
</head>
  
<body>
    <!--Normal text-->
    <p>Normal Text</p>
  
  
    <!--Text in Bold-->
    <p><b>Bold Text</b></p>
  
  
    <!--Text in Strong-->
    <p><strong> Strong Text</strong></p>
  
</body>
  
</html>

Output:

HTML <i> and <em> Tags: Both tags are used to make the text italic and emphasized. Both the element have opening and closing tags.

Syntax:

<i> ... </i>
<em> ... </em>

Example: Using the code below, this example will demonstrate how to use the <i> and <em> tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Italic and emphasized</title>
</head>
  
<body>
    <!--Normal text-->
    <p>Normal Text</p>
  
  
    <!--Text in Italics-->
    <p><i>The Text inside italic Tag</i></p>
  
  
    <!--Text in Emphasize-->
    <p><em>Emphasized Text</em></p>
  
</body>
  
</html>

Output:

HTML <small> and <big> Tags: The <small> tag is used to set small font-size where as <big> tag is used to set big font-size.

Syntax:

<small> ... </small>
<big> ... </big>

Example: Using the code below, this example will demonstrate how to use the <small> and <big> tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Small and Big</title>
</head>
  
<body>
    <!--Text in Normal-->
    <p>Normal text</p>
  
    <small>The text inside small Tag</small>
  
    <p>
        <big>The text inside big Tag</big>
    </p>
  
</body>
  
</html>

Output:

HTML <sup> and <sub> Tags: The <sup> tag is used to superscript a text whereas <sub> tag is used to subscript a text.

Syntax:

<sup> ... </sup>
<sub> ... </sub>

Example: Using the code below, this example will demonstrate how to use the <sup> and <sub> tags.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>Superscript and Subscript</title>
</head>
  
<body>
  
    <!--Text in Normal-->
    <p>Normal Text
      
    <!--Text in Superscript-->
    <p>
        <sup>superscript </sup> Text
    </p>
  
  
    <!--Text in Subscript-->
    <p>
        <sub>subscript</sub>Text
    </p>
  
</body>
  
</html>

Output:


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!