html
  1. html-sub-tag

HTML <sub> Tag

  • HTML <sub> tag represents subscript text.
  • It is used for characters or numbers that should appear slightly below the normal line of text.
  • It is commonly used for mathematical or chemical formulas, footnote markers, and more.

Syntax

The basic syntax of the <sub> tag is as follows:

<sub>Subscript Text</sub>

Example

Here is an example of how to use the <sub> tag:

<p>The chemical formula for water is H<sub>2</sub>O.</p>
Try Playground

Explanation

The <sub> tag in HTML is used to apply subscript formatting to a text or number. This tag renders the enclosed text or number at a slightly lower position relative to the normal text. It is useful in situations where you need to indicate that a character or number is a subscript.

Use

The <sub> tag in HTML is useful in situations where you want to display mathematical or chemical formulas, footnote markers, or any other content that requires a subscript effect.

Important Points

  • The <sub> tag is an inline-level element, which means it only affects the text immediately within it.
  • You can also nest other HTML elements inside the <sub> tag to apply the subscript effect to them.

Summary

The <sub> tag in HTML provides a simple way to indicate that a number or character should be displayed in subscript. It is useful for representing mathematical or chemical formulas, or as footnote markers in a document.

Published on: