當我問document.body.getBoundingClientRect().top;
版Firefox 17.0.1上有沒有風格可言一個簡單的網站,它返回錯誤的值。我期望8
,這是瀏覽器默認,但它給我21.4
。然而,.left
偏移量是正確的。Firefox的document.body.getBoundingClientRect()。top不正確?
在Chrome中的偏移量是正常工作,給我8
兩個頂部和左側。
我重視的情況截圖,你可以看到,頂部不應該是22.4.
下面是使用Firefox 18以下的HTML
<html><head>
<title>Index</title>
<style type="text/css"></style></head>
<body>
<div>
<h1>Index</h1>
<p>This is the index. The site contains in total 4 sites without
any Javascript. They are linked using href links.</p>
<p>The site looks like this:</p>
<ul>
<li>Index ->; a</li>
<li>Index ->; b</li>
<li>b ->; c</li>
<li>c ->; b</li>
<li>c ->; Index</li>
</ul>
</div>
<a href="a.html">Go to A</a>
<a href="b.html">Go to B</a>
</body></html>
問題也發生在Firefox 18.0 – Alex