HTML <sub> tag

The sub element in HTML is used to describe one or more subscript texts. If The sub tag shows the text which is presented in a smaller font and below the standard line.
We must either use the tiny tag or the sub tag when writing formulas like H2o text in chemistry.

Syntax:

<body>
<p>……………. 
<sub>…………….. </sub>
…………….</p>
</body>

Example 1:

In this example, we will learn how to use the sub tag to print any subscript text in any document:

<!DOCTYPE html>
<html>
<head>
<title> html sub tag </title>
</head>
<body>
<p>This document also contains <sub>some subscript</sub>information in it. </p>
</body>
</html>

Output:

HTML sub tag

Example 2:

<!DOCTYPE html>
<html>
<head>
<title> html sub tag </title>
</head>
<body>
<p>you can use <sub>multiple</sub>subscript tags in a <sub> document </sub>. </p>
</body>
</html>

Output:

HTML sub tag

Default CSS Settings

The following CSS values are saved as default in most of the browsers:

Example

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

Browser support:

List of browsers that support html <section> tag are discussed below:

Chrome: Yes

Microsoft Edge: Yes, version 12 needed

Firefox: Yes, version 1 needed

Safari: Yes

Opera: Yes