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.

<p>Water is H<sub>2</sub>O.</p>

Chemical Formulas

Subscripts are essential for writing chemical formulas:

Carbon dioxide (CO2) and sulfuric acid (H2SO4) are common chemical compounds.

<p> Carbon dioxide (CO<sub>2</sub>) and sulfuric acid (H<sub>2</sub>SO<sub>4</sub>) are common chemical compounds. </p>

Mathematical Notation

Variable subscripts in mathematical sequences:

In the sequence, an represents the nth term, where a1 = 1 and a2 = 1.

<p> In the sequence, a<sub>n</sub> represents the nth term, where a<sub>1</sub> = 1 and a<sub>2</sub> = 1. </p>

Footnote References

Subscripts can indicate footnote references:

This is a statement that needs clarification.1

<p> This is a statement that needs clarification.<sub><a href="#note1">1</a></sub> </p>

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.

Related Elements

  • <sup> - For superscript text
  • <var> - For mathematical variables
  • <math> - For complex mathematical expressions (MathML)