In this section, we will learn what HTML <sub> element is and how to use it.
HTML for Subscript: What is <sub> Tag in HTML?
HTML <sub> element stands for subscript and is used in an HTML document when we want to add a subscript to a word or a number etc. in a document. This subscript basically appears half a character below the normal line.
This element can be used to set footnotes as well.
The best way to learn this element is to check the example below and its result.
HTML <sub> Tag Syntax:
<sub> value </sub>
Example: HTML code for subscript
See the Pen HTML code for subscript by Omid Dehghan (@odehghan) on CodePen.
Subscript and Superscript
HTML <sub> element, as mentioned before, is used to add a subscript to a content (words, sentence etc.) on a page. While HTML <sup> element, which stands for superscript, is used when we want to add a superscript to a content (Again, could be words, sentence etc.)