Ever wondered how to add a superscript or subscript in HTML as we did while solving maths in high school?
We are used to add the superscript or subscript in google docs or microsoft word using which looked like this.
How to achieve superscript and subscript in HTML?
In HTML we can achieve the same using the tags for superscript and for subscript
<p>Example of superscript: (a + b)<sup>2</sup></p>
<p>Example of subscript: F<sub>n</sub> = F<sub>n-1</sub> + F<sub>n-2</sub></p>
Output
Example of superscript: (a + b)2
Example of subscript: Fn = Fn-1 + Fn-2
Top comments (0)