CSS: Subscript and Superscript quick snippet
May 3rd, 2010 in Code
Subscript (<sub>) and Superscript (<sup>) html tags act quirky, if not styled (different behavior from browser to browser):
- line-height is affected
- font-size varies crazy
- position is jumping.
Here's a small snippet (apply directly, keep out of reach of children. Don't swallow!):
sub { height:0; line-height:1; vertical-align:baseline; _vertical-align:bottom; position:relative; font-size:0.7em; }
sup { bottom:.5em; }
sub { top:.25em; }
God bless the variety of browsers, standards and IE6. Life would be boring without those.
Comments (1)
Pleased Fresh Year<a href=http://sdjfh.in/flexpen/>,</a> everybody under the sun! :)
by meabbagescock - 01/10/2011 @ 10:06am