HTML <sub> tag
The <sub> tag is used to define subscript text. Subscript texts are normally rendered with lowered baseline and smaller text like 2 in H2O.
Type: Inline Element
Syntax of <sub> tag
<sub>Subscript text</sub>
Supported Browsers
| Tag | Chrome | Internet Explorer | Firefox | Safari | Opera Mini |
|---|---|---|---|---|---|
| <sub> | Yes | Yes | Yes | Yes | Yes |
Full code example
<!DOCTYPE html> <html> <head> </head> <body> <p> The chemical formala of water is H<sub>2</sub>O </p> </body> </html>
Output on the browser
The chemical formala of water is H2O
More reference
<sub> tag is mainly used in writing chemical formulas and mathematical variables.
Default CSS properties of <sub> tag
sub { font-size:smaller; vertical align:sub; or vertical align:-25%; }
