Prev article
Newer
Next article
Older
To create subscript and superscript text in CSS, use the vertical-align property with the value sub and super respectively.
This is subscript
<html> This is <span class="sub-text">subscript</span> </html> .sub-text { vertical-align: sub; }
This is superscript
<html> This is <span class="super-text">superscript</span> </html> .super-text { vertical-align: super; }
This article demonstrates sub and super with CSS, but you can also use HTML tags.
See also:
Ads by Google
© Richard McGrath