HTML <sub> Tag

HTML <sub> tag is used to define subscript texts.Subscript text is under the baseline of other symbols of the line and has smaller font. The baseline passes through upper or lower edge of the symbols.

To define superscript text use <sup> tag.

Subscript text is often used for formulas.


The content of the tag is between opening (<sub>) and closing (</sub>) tags.


<!DOCTYPE html>
    <title>Title of the document</title>
    <p>Formula of water - H<sub>2</sub>O,  formula of alcohol - C<sub>2</sub>H<sub>5</sub>ОН</p>


<sub> tag supports Global attributes.