X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <sub> Tag


Example

Subscript text:

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

Try it Yourself »

Definition and Usage

The <sub> tag defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O.

Tip: Use the <sup> tag to define superscripted text.


Browser Support

Element
<sub> Yes Yes Yes Yes Yes


Differences Between HTML 4.01 and HTML5

NONE.


Global Attributes

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


Event Attributes

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


Related Pages

HTML tutorial: HTML Text Formatting

HTML DOM reference: Subscript Object


Default CSS Settings

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

Example

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

Try it Yourself »



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook