HTML SUB <sub> Tag
0 2840
HTML SUB <sub> tag is used as a Subscript tag which is used to define subscript text. Subscript text appears half a character below the normal line, and it is sometimes rendered in a smaller font.
The <sub> tag is useful when you presenting mathematical formulas used in mathematical expressions, in languages such as French as a convention to represent some abbreviations and chemical formulas such as H2O.
Syntax:
The <sub> tag is written as <sub></sub> with the subscript text inserted between the start and end tags.
Program:
<!DOCTYPE html>
<html>
<head>
<title>HTML Sub Tag</title>
<style>
p{
color: green;
font-size: 26px;
font-weight: 500;
text-transform:capitalize;
}
</style>
</head>
<body>
<h2>Example of Sub Tag</h2>
<p>The chemical formula for Water is: <b>H<sub>2</sub>O</b></p>
</html>Output:

Share:



Comments
Waiting for your comments