<sup>
<sup>
Tag
The <sup>
tag in HTML is used to create superscript text, positioning it slightly above the standard text line. It is often utilized for footnotes, exponents, and chemical formulas.
Syntax
<sup>Superscripted Text</sup>
sup
Demo
Example of superscript text:
This text contains subscript text.
This text contains superscript text.
<h1>The sub and sup elements</h1>
<p>This text contains <sub>subscript</sub> text.</p>
<p>This text contains <sup>superscript</sup> text.</p>
Definition and Usage
The <sup>
tag defines superscript text, which appears slightly raised above the normal text and is often displayed in a smaller font. It is commonly used for references, mathematical expressions, and chemical equations.
<sub>
tag.Attributes
- This element supports all global attributes.
Related Elements
<sub>
– Defines subscript text.- MathML elements such as
<msub>
,<msup>
, and<msubsup>
are used for advanced mathematical notation. - The CSS vertical-align property can be used to adjust text positioning.
Conclusion
The <sup>
tag is useful for formatting superscript text, making it ideal for footnotes, mathematical expressions, and chemical symbols. It improves readability by differentiating specialized content from standard text. For subscript formatting, the <sub>
tag should be used.
<sub>
The HTML <sub> element presents text as subscript, placing it lower than the baseline. It is commonly used in contexts like chemical formulas or mathematical expressions.
<time>
The HTML <time> element indicates a specific date or time, enabling semantic markup for date and time values that browsers and search engines can utilize for improved data interpretation.