Menu
Text & Formatting
<sub> & <sup>
Subscript and superscript text.
1Math, Chemistry, Footnotes
Use <sub> for chemical formulas like H₂O and <sup> for exponents and footnote markers.
Example Code
css
<p>H<sub>2</sub>O is water.</p>
<p>E = mc<sup>2</sup></p>
<p>See note<sup>[1]</sup>.</p>2Put the element in context
Subscript and superscript fit content such as chemical formulas and exponents. They are not a general way to create smaller text or footnote navigation. When a superscript links to a note, the link still needs an understandable destination and return path.
3Practice with a small page
Write a chemical formula using sub and an exponent using sup. Check how the baseline affects line height. Add a footnote with a real link and ensure that its label and destination remain usable at increased text size.
Finished reading?
Mark this topic as complete to track progress.