HTML <sub> Tag
Description
The <sub>
HTML tag is used to define subscript text within the content of a web page. Subscript text is typically displayed in a smaller font size and positioned slightly lower than the surrounding text. It is commonly employed in scientific and mathematical notations, chemical formulas, footnotes, and other instances where characters or numbers need to be represented in a lower position, such as in H₂O to denote water's molecular formula, where "2" is in subscript. The <sub>
tag helps maintain proper formatting and readability by ensuring that the subscripted content is visually distinct from the rest of the text.
Properties
- Permitted Parents
- Any element that accepts phrasing content
- Content
- Inline and text
- Start/End Tags
- Start tag: required, End tag: required
Example
The chemical formula for water is h<sub>2</sub>0
Attributes
None
Global Attributes
The <sub>
tag also supports the Global Attributes in HTML5
Event Attributes
The <sub>
tag also supports the Event Attributes in HTML5
Browser Support
The following table will show you the current browser support for the HTML <sub>
tag.
Desktop | |||||
![]() |
![]() |
![]() |
![]() |
![]() |
|
12 | 1 | 1 | 15 | 4 |
Tablets / Mobile | |||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
18 | 4 | 14 | 3.2 | 1 | 4.4 |
Last updated by CSSPortal on: 30th September 2023