<sub>: The SUB Element
Last updated: 2026-10-13
<sub>The SUB Element
Defines subscript text shown below the baseline, used in chemical formulas (e.g. H₂O) and math notation.
| Category | Formatting |
|---|---|
| Content Model | Phrasing content |
| Allowed Parents | Any element that accepts phrasing content |
| Content Tag | Yes — requires closing </sub> tag |
| Status | Standard |
📝 Syntax
<sub>subscript</sub>
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <sub> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: Subscript changes line height; use sparingly in long text to avoid uneven spacing.
❓ FAQ
QWhat are typical use cases for sub?
AChemical formulas (the 2 in H₂O written as
<sub>2</sub>), subscripts in math variables, and footnote numbering. It displays text below the baseline in a smaller size, with the semantics of a subscript rather than a visual offset.QHow does sub differ from CSS vertical-align?
A
<sub> carries subscript semantics with the browser default style vertical-align: sub plus a smaller font; CSS can mimic the look but without semantics. When the content truly is a subscript (chemistry, math notation) use <sub>; for pure typographic tweaks use CSS.QDoes sub affect line height?
AIt can. A lowered subscript may increase the line box height and make paragraph spacing uneven. Fix it by setting
line-height: 0 on <sub>, or adjusting the vertical-align offset so it displays without expanding the line.