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