【发布时间】:2010-12-18 13:13:40
【问题描述】:
我在 IE7 显示表格时遇到问题(不要担心它用于表格数据),其中表格行具有在 x 轴和表格分区上重复的背景图像(在本例中为 TH ) 有单独的背景图片,完全不重复。
这是一个例子:
(来源:bkit.ca)
这是 CSS:
<style>
table,
td,
th,
tr {
border: none;
}
table tr {
border-bottom: 1px solid #BEBEBE;
}
table td {
padding: 7px;
border-left: 1px solid #BEBEBE;
border-right: 1px solid #BEBEBE;
}
table th {
padding: 7px;
text-align: left;
}
table .header {
background-image: url(/images/layout/nav_background.png);
background-position: top;
background-repeat: repeat-x;
height: 37px;
border: none;
margin: 2px;
}
table .header th {
color: white;
font-weight: normal;
text-align: center;
}
table .header th.first {
background-color: transparent;
background-image: url(/images/layout/nav_left.png);
background-repeat: no-repeat;
background-position: top left;
}
table .header th.last {
background-image: url(/images/layout/nav_right.png);
background-repeat: no-repeat;
background-position: top right;
background-color: transparent;
}
</style>
这是 HTML:
<table>
<tr class="header">
<th class="first">a</th>
<th>b</th>
<th class="last">a</th>
</tr>
</table>
请不要责备我的 CSS,其中一些是“喷洒和祈祷”的 CSS,希望有什么能解决它。
所以我终其一生都无法弄清楚我为什么会遇到这个问题。 IE8 没有同样的问题。
有什么想法吗?
【问题讨论】:
标签: html css internet-explorer-7 cross-browser