html tutorial - Subscript <sub> tag in HTML - html5 - html code - html form



Subscript tag

Learn html - html tutorial - Subscript tag - html examples - html programs

  • The <sub> tag is used to show the text as subscript text.
  • This tag is mostly used for chemical Formula’s.
  • Subscript texts are placed in bottom of the Normal Line.
  • Sub tag is start with <sub> and it end with</sub>.
  • The sub tag will also support both Global Attribute and Event attribute.

Syntax for <sub> tag:

<sub>content</sub>

Differences Between HTML 4.01 and HTML5 for <sub> tag in HTML:

  • HTML 4 and HTML 5 are supports <sub> tag.

Sample Coding for <sub> tag in HTML:

Tryit<!DOCTYPE html>
<html >
    <head>
        <title>Wikitechy sub tag</title>
    </head>
    <body>
        <h2>HTML sub tag with example</h2> 
        <p>HTML tutorial by Wikitechy<sub>.com</sub></p>
    </body>
</html>

Code Explanation for <sub> tag in HTML:

code explanation for subscript sub tag

  1. <sub> tag is used to defined the text as a subscript text.

Output of <sub> tag:

output for subscript sub tag

  1. The output shows the text “.com” is displayed in subscript.

Browser Support for <sub> tag:

Yes Yes Yes Yes Yes

Related Searches to subscript tag in html