user544079
user544079

Reputation: 16629

superscript altering the line height

I have a superscript that is messing up the line spacing. How do i make it even?

I tried

sup{vertical-align:0; position: relative;}

but that doesn't help.

Any suggestions?

Upvotes: 3

Views: 3784

Answers (3)

philellsworth
philellsworth

Reputation: 31

sup{vertical-align:top; line-height:0.5em;}

This works for me, even though I have sup defined in my stylesheet. I have a link, which also has styling applied, between the <sup> and </sup> tags, but this seems to force the intended effect of keeping the line spacing consistent.

Upvotes: 0

Stephen
Stephen

Reputation: 1701

You may need to try altering the line height of the sup element to be smaller than the parent text.

sup{vertical-align:super; line-height:0.5em;}

http://en.wikipedia.org/wiki/Superscript has lots of examples that you can inspect. Some of them increase the line height of the parent, some do not.

If that isn't working for you, you can also try

sup{vertical-align:top;}

Upvotes: 1

user544079
user544079

Reputation: 16629

We can achieve it by ignoring the <sup></sup> tags and directly using something like

<span style="position:relative; top:0.3em;">

Upvotes: 1

Related Questions