HTML Tutorial

HTML Tag: <sub>

Usage of <sub>

  • Use the <sub> tag to produce subscripted text.
  • This is commonly used for chemical formulas, mathematical expressions, and footnotes.

Attributes of <sub>

  • No attributes are specific to the <sub> tag.

Examples with <sub>

  • Chemical formula: H2O
  • Mathematical expression: x2 + y2 = r2
  • Footnote: This text is in a footnote.1

Exploring the <sub> Tag: A Simple HTML Example

<!DOCTYPE html>
<html>
<head>
  <title>Example of <sub></title>
</head>
<body>
  <h1>Exploring the <sub> Tag</h1>
  <p><sub> tags are used to subscript text.</p>
  <p>Here's an example of a chemical formula: H<sub>2</sub>O</p>
  <p>And here's an example of a mathematical expression: x<sup>2</sup> + y<sup>2</sup> = r<sup>2</sup></p>
  <p>You can also use <sub> tags for footnotes.<sup>1</sup></p>
</body>
</html>