getting rid of space with the superscript in html

2019-03-01 10:59发布

superscript is leaving a big space between the line height.

code is

<span style="position:relative; bottom:0.2em; font-size: 0.8em">&reg;</span>

I am not using the <sup></sup> tag as it too leaves a big gap in the line height.

Is there a work around. I am aware that the position:relative does not render well in outlook. What's the other alternative to this?

3条回答
我想做一个坏孩纸
2楼-- · 2019-03-01 11:04

I fixed this issue by increasing the line-height of the containing paragraph <p>

查看更多
倾城 Initia
3楼-- · 2019-03-01 11:06

Outlook pads line-height when superscript is applied. One fix (with caveat!) is to do the following: apply

<style="mso-line-height-rule:exactly;"> 

to the <td> IF there are no deviations in line-height in the cell AND no images used. !!!(that's important because Outlook 2010 will cut off images if this is applied) Then, apply

<span (or sup) style="font-size: (2px or more smaller than actual font size); line-height:0; vertical-align:3px;" 

in the span tag wrapping the superscript.

SEE:   http://emaildude.blogspot.com/2011/06/superscript-and-line-heights.html  

查看更多
走好不送
4楼-- · 2019-03-01 11:17

I've made few experiments in jsFiddle and I think you will be able to use:

<sup style="line-height: 0">&reg;</sup>

in firefox it does not increases the gap between the lines

查看更多
登录 后发表回答