HTML

Subscript Text


Subscript text in HTML is used to lower text below the normal line of text, typically for footnotes, chemical formulas, and mathematical expressions.

 

Using the <sub> Tag

The <sub> tag is used to create subscript text in HTML. It lowers the text slightly below the baseline and reduces the font size.

<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Subscript Text Example</title>
</head>
<body>
    <p>This is normal text with a <sub>subscript</sub> example.</p>
    <p>Here is a chemical formula: H<sub>2</sub>O</p>
    <p>Here is a mathematical expression: C<sub>6</sub>H<sub>12</sub>O<sub>6</sub></p>
</body>
</html>