HTML and Tags

The HTML <sub> element marks subscript text and <sup> marks superscript text when the vertical position has semantic meaning, such as chemical formulas, exponents, footnote markers or ordinals.

<p>Water: H<sub>2</sub>O</p>
<p>Area: x<sup>2</sup></p>

Water: H2O

Area: x2

Use SUB/SUP for meaning, not decorative positioning Top ↑

If you only need to move text visually, use CSS. <sub> and <sup> should represent content that conventionally appears below or above the baseline.

More examples Top ↑

<p>E = mc<sup>2</sup></p>
<p>CO<sub>2</sub></p>
<p>1<sup>st</sup> place</p>

Frequently Asked Questions Top ↑

What is SUB used for?

Subscript text such as the 2 in H2O.

What is SUP used for?

Superscript text such as an exponent or footnote marker.

Should SUB/SUP be used to make text smaller?

No. Their purpose is semantic subscript/superscript placement.

Can CSS style them?

Yes.

Can SUB and SUP appear inside paragraphs?

Yes, they are phrasing elements.





plus2net.com







02-12-2020

VERY NICE



We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer