2012-07-27 87 views
0

我希望這只是一個糟糕的夢想,但是當我在Photoshop中測量兩個元素的寬度時,會得到不正確的大小。Internet Explorer不正確地呈現元素的寬度

<!DOCTYPE HTML> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<title>Untitled Document</title> 

<style>* { margin: 0; padding: 0; border: 0: border-collapse:collapse;}</style 

</head> 



<body> 

    <table width="129" border="0" cellpadding="0" cellspacing="0" style="width:129px; height:18px;background-color:black;"> 
    <tr> 
     <td>&nbsp;</td> 
    </tr> 
</table> 
Renders above table as 134 pixels 

<br/> 

<div style="width:29px;height:18px;background-color:Black;"></div> 
    ​ 
Renders above div as 30 pixels 
</body> 
</html> 

回答

2

瀏覽器縮放級別是100%嗎?測試IE7/8/9的測量結果爲129px和29px,但放大到一個級別(105%),他們變成了你所說的134px和30px。

+0

好一個!謝謝! – user1556451 2012-07-27 10:39:51

相關問題