<sup>

Term side of the Card.
Topic: Semantics
Unit title: <sup>
Categories: Tag
Explanation side of the Card

Explanation: The element that displays text as superscript, positioning it higher than the normal text line. It's often used for footnotes, ordinal indicators and mathematical exponents.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 1.
  • The safari browser supports this feature starting from version 4.
Availability: 

Example

Wronghtml
<p>
  Area: 20m<span class="up">2</span>
</p>
Righthtml
<p>
  Area: 20m<sup>2</sup>
</p>

<sup> carries the meaning of an exponent instead of relying on a custom class.

Common mistakes

  • Using <sup> for visual style only, like raising a logo mark.
  • Footnote markers in <sup> without a link to the footnote.

Interview questions

How do I stop <sup> from breaking line spacing?

Set sup { line-height: 0; } so the raised text does not grow the line box.

Should footnote references use <sup>?

Yes, a common pattern is <sup><a href="#fn1">1</a></sup> with a link back from the footnote.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy