IE7选择框比其他浏览器大

时间:2012-11-15 16:28:51

标签: css internet-explorer-7

与IE8 +和FireFox相比,IE7似乎为选择框添加了内部填充。

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

在Firefox中,所有表格行都显示在固定高度div中。 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 个答案:

答案 0 :(得分:1)

你,我的朋友错过了reset.css的荣耀。拥抱自己

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

编辑:没有解决方法。

Edit2:此处有更多讨论 - Setting the height of a SELECT in IE

相关问题