Web4College

HTML sub tag

HTML <sub> tag defines subscript. sub element is commonly used in equation (Mathematical, Chemical).

Example
Try it
<p>See the equation of logarithm</p>
<p>y = log<sub>a</sub>x</p>

See the equation of logarithm

y = logax

Tag Uses

Specific uses of <sub> tag

sub element has been used in the equations and formulas.

<var> element should also be used with sub element to write the equations. In the following example, <var> tag is also used.

Preview Example
Try it

Tag omission

Both starting and ending tags are necessary for the sub element.

Global Attributes

All the global attributes are applicable on the sub element.