Skip to main content
Participant
December 24, 2010
Question

CSS Superscript and line spacing

  • December 24, 2010
  • 2 replies
  • 1647 views

Hi everybody,

I've managed to get a SUBscript without messing the line spacing, using

vertical-align: baseline;

position: relative;

top: 0.4em

AND - I don't know why I had to do this too, but it worked - enclosing each subscript element with <span class="sub"></span> in the XHTML.

Now: I can't do the same with SUPERscript. I've tried -0,4em, tried bottom, tried bottom AND -0.4, tried top.... Do I have to monkey with the XHMTL again????

Superscript work when I simply use vertical-align: super, but I don't like the result.

Please help! Thank you!

This topic has been closed for replies.

2 replies

Harbs.
Legend
December 28, 2010

Did this have something to do with InDesign?


Participant
December 28, 2010

Not at all. Just a matter of XHTML/CSS, apparently.


Jeremy bowmangraphics
Inspiring
December 24, 2010

You might try a combination of

vertical-align: super;

and

line-height: 0;

(in some browsers, you also have to make sure line-height of the surrounding text is 1.40em or greater).

Participant
December 26, 2010

Thank you very much, it has been as simple as that!

Participant
December 26, 2010

Question answered!