🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<sup>

AI & DATA SCIENCE // sup-tag

The <sup> element renders text as superscript — shifted above the baseline in a smaller font, commonly used for exponents, footnotes, and ordinal indicators.

Syntax

E = mc<sup>2</sup>

Deep Dive Course

**`<sup>`** shifts its content above the normal text baseline, matching the typographic convention for superscript. Common uses include mathematical exponents (x<sup>2</sup>), ordinal number suffixes (1<sup>st</sup>, 2<sup>nd</sup>), and footnote reference markers that link to a note elsewhere on the page.

1Understanding <sup>

`<sup>` shifts its content above the normal text baseline, matching the typographic convention for superscript. Common uses include mathematical exponents (x<sup>2</sup>), ordinal number suffixes (1<sup>st</sup>, 2<sup>nd</sup>), and footnote reference markers that link to a note elsewhere on the page.

💡

For footnote markers, pair <sup> with an actual link (<a href="#footnote-1">) so keyboard and screen reader users can navigate to the note, not just see a raised number.

editor.html
<p>Einstein's famous equation is E = mc<sup>2</sup>.</p>
localhost:3000

2Practical Example

Here is a real-world application of <sup> showing how it is used in production HTML.

editor.html
<!-- Footnote reference marker as a navigable link -->
<p>This claim needs verification.<sup><a href="#fn1">1</a></sup></p>
<p id="fn1">1. Source: Example Journal, 2026.</p>
localhost:3000

3Best Practices

Follow these guidelines when working with <sup>:

1. Use <sup> for exponents, ordinal suffixes, and footnote markers

2. Wrap footnote markers in a link so they're navigable, not just visually raised

3. Avoid using it purely for decorative raised text unrelated to these conventions

⚠️

Tip: For footnote markers, pair <sup> with an actual link (<a href="#footnote-1">) so keyboard and screen reader users can navigate to the note, not just see a raised number.

editor.html
<p>Einstein's famous equation is E = mc<sup>2</sup>.</p>
localhost:3000

Examples

Example 01Basic Usage
<p>Einstein's famous equation is E = mc<sup>2</sup>.</p>
Example 02Advanced Example
<!-- Footnote reference marker as a navigable link -->
<p>This claim needs verification.<sup><a href="#fn1">1</a></sup></p>
<p id="fn1">1. Source: Example Journal, 2026.</p>

Best Practices

  • Use for exponents, ordinal suffixes, and footnote markers
  • Wrap footnote markers in a link so they're navigable, not just visually raised
  • Avoid using it purely for decorative raised text unrelated to these conventions

Interview Question

Why should a footnote marker use both <sup> and an <a> link, rather than just <sup> alone?

Hint: Think about how a keyboard-only or screen reader user would navigate to the footnote.

<sup> alone only provides visual styling — it raises the number but gives no way to actually reach the footnote's content. Wrapping the number in an <a href="#footnote-id"> inside the <sup> makes it a real, keyboard-navigable and screen-reader-announced link that jumps to the corresponding note, which is the whole point of a footnote reference.

Exercises

EasyPractice using <sup> in a real scenario.
View Solution
<p>Einstein's famous equation is E = mc<sup>2</sup>.</p>

Frequently Asked Questions

Why should a footnote marker use both <sup> and an <a> link, rather than just <sup> alone?

alone only provides visual styling — it raises the number but gives no way to actually reach the footnote's content. Wrapping the number in an inside the makes it a real, keyboard-navigable and screen-reader-announced link that jumps to the corresponding note, which is the whole point of a footnote reference.