sub
Represents subscript text, typically displayed lower and smaller.
Description
The <sub> element specifies inline text which should be displayed as subscript for solely typographical reasons. Subscripts are typically rendered with a lowered baseline using smaller text. Common uses include chemical formulas, mathematical expressions (like variable subscripts), and footnote references.
Use <sub> only for typographical conventions, not for purely presentational purposes. For styling purposes, use CSS (vertical-align: sub).
Basic Example
Water is H2O.
Chemical Formulas
Subscripts are essential for writing chemical formulas:
Carbon dioxide (CO2) and sulfuric acid (H2SO4) are common chemical compounds.
Mathematical Notation
Variable subscripts in mathematical sequences:
In the sequence, an represents the nth term, where a1 = 1 and a2 = 1.
Footnote References
Subscripts can indicate footnote references:
This is a statement that needs clarification.1
Attributes
This element supports global attributes.
Accessibility
Screen readers may not announce subscript formatting. For chemical formulas or mathematical notation where the subscript is meaningful, consider providing additional context or using MathML for complex expressions.