Loading...
HTML <sub> Tag

HTML <sub> Tag

In this tutorial, we will learn about sub tag in HTML with the help of examples.


<sub> Tag

Sub tag <sub> is used for defining subscript text(text appears below the normal line in smaller font size).

Syntax

<sub>..........</sub>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Sub Tag</title>
  </head>
  <body>
      <p>H<sub>2</sub>O</p>
  </body>
</html>

Output

H2O


Global Attribute

Sub Tag support all the global attributes of HTML.


Event Attribute

Sub Tag support all the event attributes of HTML.


Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of <sub> tag in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML <summary> Tag.

- Related Topics