HTML sub tag
HTML

HTML sub tag

Editorial Team
Editorial Team

Follow us on Discord or Telegram to get access to free tutorials and updates.

The HTML <sub> (subscript) tag is used to define a subscript. Any text written in a sub tag will be displayed in a little lower position than normal text. The text will also appear in a smaller size.

This tag is useful for displaying some mathematical equations or chemical formulas.

To display a superscript, use <sup> tag.

Syntax

<sub>Subscript text</sub>

Example

<!DOCTYPE html>
<html>
<head>
    <title>HTML sub tag</title>
</head>
<body>
    <p>H<sub>2</sub>O</p>
</body>
</html>

Output

H2O