The <sub> element represents a subscript.


  • This element must be used only to mark up typographical conventions with specific meanings.

HTML Attributes

See global attributes.


Example A

Mathematical expressions often use subscripts and superscripts. Authors are encouraged to use MathML for marking up mathematics, but authors may opt to use sub and sup if detailed mathematical markup is not desired [try it]:

<p>f(<var>x</var>, <var>n</var>) = log<sub>4</sub><var>x</var><sup><var>n</var></sup></p>


HTML Reference

The HTML5 specification defines the <sub> element in 4.6.15 The sub and sup elements.

Last modified on 22 July 2011, at 15:00