Solution - how to superscript without affecting line spacing

by Charles A Upsdell <cupsdell(at)upsdell.com>

 Date:  Mon, 03 Mar 2003 13:12:00 -0500
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
Thought I would share a discovery.

A problem that has nagged me throughout the years is how to avoid changing 
the line spacing when using superscripts.  The HTML way to superscript is 
to do something like 2<sup>nd</sup>, which pushes the superscript up so 
high that the line spacing typically expands to make room for it.  Here is 
some CSS that fixes the problem:

       sup { vertical-align:text-top; }

Likewise for subscripts you can also do:

      sub { vertical-align:text-bottom; }

[]  HTH, Chuck Upsdell

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA