Description

The <sub> (short for subscript) tag renders enclosed text as superscript. Superscript text appears half a character's height above the baseline, and is most often used in mathematical (e.g. y = x2), or scientific formulas (e.g. E = mc2).

The following table summarizes the usages context and the version history of this tag.

Placement:Inline
Content:Inline and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 3.2, 4, 4.01, 5

Usage Notes:

  • The <sup> tag should be used for typographical reasons only.
  • ]This tag must not be used for styling purpose like changing the vertical position of the text. In that case CSS should be used instead: the vertical-align property with the super value will achieve the same effect.

Syntax

The basic syntax of the <sup> tag is given with:

HTML/XHTML: <sup> ... </sup>

The example below shows the <sup> tag in action.

<p>The equation of mass–energy equivalence is: E=mc<sup>2</sup></p>

Tag-Specific Attributes

The <sup> tag doesn't have any specific attribute.

Global Attributes

Like all other HTML tags, the <sup> tag supports the glodelal Attributes in HTML5.

Event Attributes

The <sup> tag also supports the event Attributes in HTML5.

Browser Compatibility

Element
<sup>YesYesYesYesYes