HTML Formatting

Different tags to format text are as follows.

Bold

<b> tag is used to display text in bold face style.

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Bold Text</title> 
    </head>
  
    <body> 
        <b>Formatting makes things cool.</b>
    </body>

</html>

Italic

tag is used to display text in italic style..

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Italic Text</title> 
    </head>
  
    <body> 
        <i>Italic text looks stylish.</i>
    </body>

</html>

Underline

<u> tag is used to display text as underlined.

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Underlined Text</title> 
    </head>
  
    <body> 
        <u>Underlined text looks prominent.</u>
    </body>

</html>

Superscript

<sup> tag is used to display text as superscript.

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Superscript Text</title> 
    </head>
  
    <body> 
        N<sup>2</sup>
    </body>

</html>

Subscript

<sub> tag is used to display text as subscript.

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Subscript Text</title> 
    </head>
  
    <body> 
        N<sub>2</sub>
    </body>

</html>

Font

<font> tag is used to specify the characteristics of font. Different characteristics include the typeface, size and color.

Example:

<!doctype html>  
<html>
 
    <head> 
        <title>Font Text</title> 
    </head>
  
    <body> 
        <p><font face="verdana" color="green" size="2">PHPDocs is best to learn Web Development</font></p>
    </body>

</html>