Nearby lessons
23 of 24🔼 <sup> Tag
📌 What is the <sup> Tag?
The
<sup> HTML tag is used to define superscript text. Superscript text appears half a character above the normal line and is often used in mathematical expressions, footnotes, and ordinal indicators (like 1st).📌 Syntax
Wrap the text you want to display as superscript using the
<sup> tag.Code Example
PREVIEW READY
🔍 Use Cases
- Mathematical expressions (e.g., x2)
- Footnotes and citations (e.g., see note1)
- Ordinal numbers (e.g., 1st, 2nd)
⚙️ Attributes
| Attribute | Description |
|---|---|
Global Attributes | The <code><sup></code> tag supports all global HTML attributes. |
Event Attributes | Supports event-related attributes like <code>onclick</code>, <code>onmouseover</code>, etc. |
✅ Best Practices
- Use
<sup>only for superscript content such as exponents or footnotes. - Avoid using
<sup>for visual styling — use CSS instead if the intent is design-only. - Ensure proper semantic use for accessibility and screen readers.
- Include a
titleattribute for clarification if the superscript has special meaning. - Do not overuse
<sup>— use it where it improves readability and structure.
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2
Keep Going!HTML Semantic