2012-11-15 23 views
0

與IE8 +和FireFox相比,IE7似乎添加了一個內部填充框來選擇框。IE7選擇框大於其他瀏覽器

小提琴:http://jsfiddle.net/R4KhQ/7/

在Firefox中,所有錶行出現在固定的高度專區內。 div上沒有滾動條。 在IE7中,select元素更大,因此將一些表格行從div底部推出。然後出現滾動條。

如何標準化選擇框樣式,以便高度是相同的跨瀏覽器而不切斷文本?

HTML

<div id="container"> 
<table> 
    <tr> 
     <th>column1</th> 
     <th>column2</th> 
     <th>column3</th> 
    </tr> 
    <tr> 
     <td>column1</td> 
     <td>column2</td> 
     <td> 
      <select> 
       <option>An Option</option> 
       <option>Another Option</option> 
       <option>Yet Another Option</option> 
      </select> 
     </td> 
    </tr> 

(重複TR行)

</table> 
</div> 

CSS

#container { 
    border: 1px solid black; 
    width: 500px; 
    height: 330px; 
    overflow: auto; 
} 

table { 
    border-collapse: collapse; 
    border-spacing: 0; 
    width: 100%; 
} 

th{ 
    font-weight: bold; 
} 

回答

1

你,我的朋友失蹤reset.css的榮耀。擁抱自己

http://www.cssreset.com/?utm_expid=37596592-1

編輯:有沒有辦法解決這個。

EDIT2:這裏更多的討論 - Setting the height of a SELECT in IE

+0

我把復位CSS v2.0和它沒有固定的選擇框問題。你能給我發一個鏈接到一個工作小提琴嗎? – psynnott

+0

似乎沒有解決方法。更多信息 - http://stackoverflow.com/questions/490036/setting-the-height-of-a-select-in-ie – srijan

+0

如果你想更新你的答案,說沒有解決方法,我會接受它。謝謝 – psynnott

相關問題