HTML Subscript and Superscript

HTML Subscript and Superscript

HTML Subscript and Superscript

HTML Subscript and Superscript is used to give formatting to the text on the web page.

  • sub tag makes text smaller and moves downward from the normal position which shows that the text is subscript text.

  • sup tag makes text smaller and moves upward from the normal position which shows that the text is superscript text.

  • HTML Subscript is defined by <sub> tag.

  • HTML Superscript is defined by <sup> tag.


Example:
The Formula of water is H<sub>2</sub>O.
Run Code »
Example Explanation:

In the above, we have shown an example of HTML Subscript.

  • <sub> tag moves the text slightly downward which is used to show chemical formulae on the web page.

Run the code to see the effect.

Example:
The volume of a cube is a<sup>3</sup>.
Run Code »
Example Explanation:

In the above, we have shown an example of HTML Superscript.

  • <sup> tag moves the text slightly upward which is used to show mathematical formulae on the web page.

Run the code to see the effect.




Application

HTML Superscript is used to write Mathematical Formulas.

HTML Subscript is used to write Chemistry Formulas.

HTML Subscript and Superscript in Hindi

Best Use:360p or more (480p or 720p)
×

Course Menu