Skip to content

11. sub Tag

The <sub> (subscript) element displays text below the normal baseline, making it smaller. It’s commonly used for chemical formulas, mathematical expressions, and footnotes. The sub element has semantic meaning, indicating that the text should be rendered as subscript.

<p>Water: H<sub>2</sub>O</p>
<p>Carbon dioxide: CO<sub>2</sub></p>
<p>Glucose: C<sub>6</sub>H<sub>12</sub>O<sub>6</sub></p>
<p>Logarithm: log<sub>2</sub>(x)</p>
<p>This is text with a footnote<sub>1</sub>.</p>
<p><sub>1</sub>This is the footnote content.</p>