Subscript and Superscript of HTML
1.5 Subscript Element
The <sub>
tag is used to define subscript text, which is text that appears below the normal line of text. This is commonly used in mathematical or chemical formulas.
Example:
H<sub>2</sub>O <!-- Water formula -->
The output will display H₂O
, with the 2
in subscript.
1.6 Superscript Element
The <sup>
tag is used to define superscript text, which is text that appears above the normal line of text. This is commonly used for footnotes or mathematical powers.
Example:
x<sup>2</sup> <!-- Mathematical square -->
The output will display x²
, with the 2
in superscript.
Comments
Post a Comment