HTML <sub> tag

HTML <sub> tag : Definition


• The The HTML <sub> element stands for subscript, this is used to add the subscript text to the HTML document.

• The subscript(<sub>) text appears half a character below the normal line and it is sometimes rendered in a smaller font.

• The <sub> element can be used for chemical formulas, like CO2 to be written as CO2.



Html <sub> tag example

<!DOCTYPE html>
<html>
<head>
<title>sub Tag example</title>
</head>
<body>
 <p>The chemical formula for Sulphuric acid is: H<sub>2</sub>SO<sub>4</sub></p>
 <p>The chemical formula for Salt is: N<sub>a</sub>CL</p>
 <p>The chemical formula for Water is: H<sub>2</sub>O</p>
 <p>The chemical formula for carbon dioxide is: CO<sub>2</sub></p> 
</body>
</html>

Output :


 

The chemical formula for Sulphuric acid is: H2SO4

The chemical formula for Salt is: NaCL

The chemical formula for Water is: H2O

The chemical formula for carbon dioxide is: CO2