HTML sub tag

The HTML subscript tag is used to define a subscript. Any text written in a sub tag will appear in a smaller size and below the base of normal text.

HTML sub tag

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


Share Tweet Send
Loading...
You've successfully subscribed to Geekinsta
Great! Next, complete checkout for full access to Geekinsta
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.