**`<sub>`** shifts its content below the normal text baseline and typically shrinks the font size, matching the typographic convention for subscript. The most common use case is chemical formulas, like H<sub>2</sub>O or CO<sub>2</sub>, where the subscript number is part of the compound's name, not a footnote or citation marker (which typically uses `<sup>` instead).
1Understanding <sub>
`<sub>` shifts its content below the normal text baseline and typically shrinks the font size, matching the typographic convention for subscript. The most common use case is chemical formulas, like H<sub>2</sub>O or CO<sub>2</sub>, where the subscript number is part of the compound's name, not a footnote or citation marker (which typically uses <sup> instead).
Don't use <sub> purely for visual/layout adjustments like fine-tuning vertical alignment — that's a job for CSS vertical-align, not a semantic subscript element.
<p>Water is H<sub>2</sub>O and carbon dioxide is CO<sub>2</sub>.</p>2Practical Example
Here is a real-world application of <sub> showing how it is used in production HTML.
<!-- Mathematical subscript notation -->
<p>The sequence is defined as a<sub>n</sub> = a<sub>n-1</sub> + 2</p>3Best Practices
Follow these guidelines when working with <sub>:
1. Use <sub> for genuine subscript notation like chemical formulas (H<sub>2</sub>O)
2. Don't use it purely to shrink or lower text for styling reasons
3. Keep subscript content short — a character or two, not full sentences
Tip: Don't use <sub> purely for visual/layout adjustments like fine-tuning vertical alignment — that's a job for CSS vertical-align, not a semantic subscript element.
<p>Water is H<sub>2</sub>O and carbon dioxide is CO<sub>2</sub>.</p>