HTML sub tag

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

<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.

Example

See the equation of logarithm

y = logax

See the equation of motion

vf = vi + at

The chemical formulas have been given below.

H2SO4, HNO3, H3PO4

Try </>

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.



Was this article helpful?