html
  1. html-sup-tag

HTML <sup> Tag

  • The HTML <sup> tag is used to define superscript text.
  • Superscript text appears half a character above the normal line and used to denote powers or exponents.

Syntax

The basic syntax of the HTML tag is:

<sup>Superscript</sup>

Example

Let's see an example of how to use the HTML <sup> tag:

x<sup>2</sup>
Try Playground

Explanation

The HTML <sup> tag is a non-container tag which means it doesn't have an opening and closing tag. It is used to place superscript text in HTML. When we enclose any text or number within the tags, it is displayed in superscript format.

Use

The HTML <sup> tag is commonly used to show powers in math equations or reference numbers such as footnote references.

Example:

Einstein's famous equation: E=mc<sup>2</sup>

Important Points

  • The HTML <sup> tag can only be used within text and it does not affect the line-height or spacing of the adjacent text elements.
  • The use of <sup> tag is typically reserved for mathematical or scientific formulae, footnotes, and superscript text.

Summary

The HTML <sup> tag is a simple and useful tag in HTML that makes it easy to display superscript text. It is used to raise the text to a higher position than the rest of the line. Enclosing text or a number within the <sup> </sup> tags is all that is required and it is widely used when writing mathematical expressions or scientific documents.

Published on: