What is HTML Subscript Element?
In HTML, <sub>
(subscript) element is used to render text in a smaller size and half a character below the normal line in a webpage.
The <sub>
tag is often used to write mathematical or chemical formulas and footnotes.
Example of Creating HTML Subscript Text
In the following example, let us write the chemical formula of water.
Create an HTML <sub>
element in a <p>
element.
Place the text "2" between the <sub>
and </sup>
tags after text "H" as shown in the following example.
Example of HTML Superscript Element
Output of the above example
Example of Subscript Text
H2O (water) is an example of HTML subscript text.
<sub> tag is used to display subscript text
Here is an example of Mathematical formula (radius of a circle):