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?


Jeremy bowmangraphics
Inspiring
December 28, 2010

Harbs. wrote:

Did this have something to do with InDesign?

As time goes by, InDesign users -- who are most comfortable with PDFs and print -- find they have to deal with XML, export to EPUB, and all that sort of thing.

Maybe it is time to start an InDesign forum for "code" issues. Nowadays InDesign users (who make EPUBs) really need to have some familiarity with HTML, CSS, XML, etc..

I'm not sure where I would ask a question about XSLT, as I hardly count that as any sort of "scripting" language, but it seems to me that the closest we have, so far, is the scripting forum. So it seems to me to be reasonable enough to ask -- and to attempt to answer -- a "coding"-type question about HTML and CSS right here.

There's "a place for everything and everything in its place",  sure, but there are fuzzy transitions too!

Harbs.
Legend
December 28, 2010

Interesting idea.

I think I'll post the idea on the main forum to see how many people are for forming a new sub-forum...

Harbs

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!