1
我遇到了一些与IE7和固定布局和固定列大小的问题。大多数浏览器使用列的宽度来设置单元格的大小,包括填充,但IE7似乎将其设置为排除填充,因此存在过度挂起。IE7 - 固定列宽度问题,当单元格有填充时
我搜索,搜索和搜索了一个解决方案,但我找不到任何东西,除了应用“框大小:边框”的一切,这是不可能的。删除“table-layout:fixed”也适用,但其他代码依赖于此。
如何在浏览器之间获得一致性?
<!-- DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" -->
<html>
<head>
<style type="text/css">
div {
width: 200px;
height: 10px;
background-color: blue;
}
table {
width: 200px;
border-collapse: collapse;
table-layout: fixed;
}
.first {
width: 50px;
background-color: green;
}
.second {
width: 150px;
background-color: red;
}
.alt {
padding: 10px;
}
</style>
</head>
<body>
<div></div>
<table>
<colgroup>
<col class="first" />
<col class="second" />
</colgroup>
<tr>
<td>Foo</td>
<td class="alt">bar</td>
</tr>
</table>
</body>
</html>
类似的问题:<col> width and padding - IE7
IE7 SS
IE9 SS
您需要使用条件语句。 <! - [if IE 7]> IE7的特别说明在这里 – 2012-07-25 03:38:26