<sup>
Example
<p>
Area: 20m<span class="up">2</span>
</p><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?
<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>?
<sup>?Yes, a common pattern is <sup><a href="#fn1">1</a></sup> with a link back from the footnote.