2
在Firefox和Chrome和Safari(最新的所有,在Mac 10.6.8)如果我使用浏览器的开发人员工具缩小以下跨度的字体大小,我可以观看段落的高度(线条高度) 几个像素提高:为什么段落变得越来越高?
<p style="line-height: 40px; background: red;">
Some sample text some sample text.
<span style="font-size: 100%;">As this span's text size gets smaller, the paragraph gets taller.</span>
</p>
有人可以解释为什么出现这种情况?
这是一个引人入胜的问题!最有趣的是,段落加载了不正确的行高(41px),然后在跨度减小到96%之后假设正确的(40px)。 – skybondsor 2012-02-01 23:26:20
我还没有试过这个,但是尝试为'span'设置'display:inline-block'。当我遇到这种问题时,这种修复方法通常可行...... – elclanrs 2012-02-03 03:54:26