SUP and sub tags for XHTML documents
The <sup> and <sub> tags indicate the inclusion of superscript and subscript characters in the text, especially when the document is written about mathematics or chemistry, or where the language requires superscript and subscript (such as French). Superscript text is positioned slightly higher than surrounding text, while subscript text is slightly lower than the surrounding text. The following code represents the Pythagorean theorem and the chemical formula.
<p>a<sup>2</sup>+b<sup>2</sup>=c<sup>2</sup></p><p>H< Sub>2</sub>so<sub>4</sub></p>
The result of the code presentation is as follows:
Although the SUP and sub elements are inherently expressive, they can sometimes convey more meaning than span elements. The superscript number in a mathematical formula may represent an exponent, so the semantics of wrapping the number in the SUP element might be preferable to defining its style entirely with CSS, and the SUP element itself already contains this style meaning. You should use your judgment only when the content needs these elements.
(015) SUP and sub tags for XHTML documents