HTML Formatting

HTML have elements which helps in defining text with special meaning.

We are going to use Formatting tags with program:

HTML <b>


The <b> tag is used to display Bold

Example <b>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
            <b> This is Bold</b>
      </body>
</html>



Output


This is Bold

HTML <i>


The <i> tag is used to display Italic

Example <i>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
            <i> This is Italic</i>
      </body>
</html>



Output


This is Italic

HTML <strong>


The <strong> tag is used to display Strong

Example <strong>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
            <strong> This is Strong</strong>
      </body>
</html>



Output


This is Strong

HTML <em>


The <em> tag is used to display emphasized

Example <em>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
            <em> This is emphasized</em>
      </body>
</html>



Output


This is emphasized 

HTML <small>


The <small> tag is used to display Smaller text

Example <small>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <small> small</small> text</h2>
      </body>
</html>



Output


This is small text

HTML <mark>


The <mark> tag is used to display highlighted text

Example <mark>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <mark> marked</mark> text<h2>
      </body>
</html>



Output


This is marked text

HTML <del>


The <del> tag is used to display Deleted text

Example <del>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <del> Deleted</del> text<h2>
      </body>
</html>



Output


This is Deleted text

HTML <ins>


The <ins> tag is used to display Inserted text

Example <ins>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <ins> Inserted</ins> text<h2>
      </body>
</html>



Output


This is Inserted text

HTML <sub>


The <sub> tag is used to display Sub scripted text

Example <sub>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <sub> Subscripted</sub> text<h2>
      </body>
</html>



Output


This is Subscripted text


Another Example <sub>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> CO<sub> 2</sub>  OR  H<sub> 2</sub>O <h2>
      </body>
</html>



Output


CO2 OR H2O

HTML <sup>


The <sup> tag is used to display Super scripted text

Example <sup>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> This is <sup> Superscripted</sup> text<h2>
      </body>
</html>



Output


This is Superscripted text


Another Example <sup>




<html>
      <head>
            <title>
            </title>
      </head>
      <body>
           <h2> (a+b)<sub>2</sub> = a<sub>2</sub> + b<sub>2</sub> +2ab<h2>
      </body>
</html>



Output


(a+b)2=a2+b2+2ab

Back To Top