<sub> : The Subscript element

Introduction

The <sub> element in HTML is used to define subscript text. Subscript text appears slightly below the normal baseline and is typically used for footnotes, chemical formulas, mathematical expressions, or any text that needs to be displayed in a smaller size below the regular text.

Here’s an example of how you might use the <sub> element:

Output:

In this example, the <sub> element is used to represent the subscript “2” in the chemical formula for water (H₂O), indicating the number of hydrogen atoms. When rendered in a browser, the “2” will appear slightly below the baseline of the surrounding text.

Leave a Comment