我希望表格的标题单元格具有特定的边框颜色和渐变填充。我想让它看起来像这样:
以下是上述内容的HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table>
<thead>
<tr>
<th>Column00</th>
<th>Column01</th>
<th>Column02</th>
</tr>
</thead>
<tbody>
<tr>
<td>Feline</td>
<td>Cat</td>
<td>Felidae</td>
</tr>
<tr>
<td>Canine</td>
<td>Dog</td>
<td>Caninae</td>
</tr>
<tr>
<td>Primate</td>
<td>Ape</td>
<td>Primates</td>
</tr>
</tbody>
</table>
</body>
</html>
以下是CSS代码:
table{
border-collapse: collapse;
}
th{
border: 3px #449944 solid;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#44bb44'); /* IE */
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#44bb44)); /* Chrome */
background: -moz-linear-gradient(top, rgba(255,255,255,1), rgba(85,205,85, 1));
}
它在Chrome 12和Firefox 5中显示完美,但在IE 9中看起来像这样:
看起来IE9将梯度填充放在边框上面。如何让IE9将TH元素的边框显示在“上面”?
TIA。
th{ border-collapse: no-collapse;
来解决。 - Kyle