What is HTML Superscript Element?
In HTML, <sup>
(superscript) element is used to render text in a smaller size and above the baseline in a webpage.
The <sup>
tag is often used for thing like exponents.
Example of Creating HTML Superscript Text
Create an HTML <sup>
element in a <p>
element.
Place the text "2" between the <sup>
and </sup>
tags after text "a" and "b" as shown in the following example.
The text "2" will be displayed in a smaller size and raised above the baseline text "a" and "b".
Example of HTML Superscript Element
Output of the above example
Example of Superscript Text
a2 + b2 is an example of HTML superscript text.
<sup> tag is used to display superscript text
Let us consider another example of superscript: