4

How to get cross browser <sup> without interrupting line height?

I tried vertical-align:top but it looks ok in FF 3.6 and IE but not in FF 3.0.

How to get consistent in size (size of superlative text) and position of <sup> identical in all browsers without interrupting line height.

I'm using <sup> to indicate footnote? not to show power

<p> Stackoverflow is killing<sup>10</sup> experts-exchange</p>
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
  • Possible duplicate of [this](http://stackoverflow.com/questions/1530685/html-sup-tag-affecting-line-height-how-to-make-it-consistent) question. The [second answer](http://stackoverflow.com/a/6594576/564181) resolves the problem nicely. – Chris Krycho Jun 03 '13 at 20:27

3 Answers3

4

Your best chance for a consistent rendering are real superscripts:

HTML

<p>Stackoverflow is killing<span class="unicode">¹⁰</span> experts-exchange</p>

CSS

.unicode
{
    font-family: 'Lucida Sans Unicode', 'DejaVu Sans', 'Arial Unicode MS';
}

Live

Stackoverflow is killing¹⁰ experts-exchange

fuxia
  • 62,923
  • 6
  • 54
  • 62
  • Just use real superscript numbers. The CSS is helping browsers to find a font with these numbers. – fuxia Apr 01 '10 at 14:04
1
sup {
    vertical-align: super;
    height: 0;
    line-height: 1;
}

If that doesn't work, you can take it a bit further..

sup{
    height: 0;
    line-height: 1;
    vertical-align: baseline;
    _vertical-align: bottom;
    position: relative;
    bottom: 1ex;
}
Pops
  • 30,199
  • 37
  • 136
  • 151
snsr
  • 11
  • 1
0
vertical-align: text-top;
reisio
  • 3,242
  • 1
  • 23
  • 17