HTML <sub> tag

Definition and usage

<sub> Label defines subtext. Subtext appears below the half character position of the normal line and is sometimes presented in a smaller font.

Subscript text can be used in chemical formulas, such as H2O.

Tip:Please use <sup> tag Define superscript text.

See Also:

HTML Tutorial:HTML Text Formatting

HTML DOM Reference Manual:Subscript Object

Example

Subscript Text:

<p>This text contains <sub>subscript</sub> text.</p>

Try It Yourself

Global Attributes

<sub> The tag also supports Global Attributes in HTML.

Event Attributes

<sub> The tag also supports Event Attributes in HTML.

Default CSS Settings

Most browsers will display the following default values <sub> Element:

sub {
  vertical-align: sub;
  font-size: smaller;
}

Try It Yourself

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support