DEV Community

Cover image for HTML tags | sub-sup
Carlos Espada
Carlos Espada

Posted on • Edited on

HTML tags | sub-sup

They are used to create subscripts and superscripts, for example in mathematical or chemical formulas, to indicate footnotes, in abbreviations in some languages (Mademoiselle) or certain ordinals (4th).

The included text is usually displayed in a smaller font and either below (subscript) or above (superscript) the baseline of the rest of the text.

It should not be used to alter the baseline of a text for purely aesthetic reasons, as in a logo, in that case CSS will have to be used.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition and example <sub> - Definition and example <sup> | Support <sub> - Support <sup>

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →