这里显示了我遇到的问题。基本上,当我在 thead 上放置渐变时,Chrome 会为每个单元格重复该渐变...实际期望的结果是 firefox 产生的结果 - 整个 thead 的纯渐变。
关于如何解决这个问题有什么想法吗?
这是我的 CSS:
thead.header {
font-weight: bold;
border-bottom: 1px solid #9C9C9C;
background-repeat: no-repeat;
background: #C6C6C6;
background: -moz-linear-gradient(top, #DEDEDE 0%, #BDBDBD 80%, #BBB 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#DEDEDE), color-stop(80%,#BDBDBD), color-stop(100%,#BBB));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#DEDEDE', endColorstr='#BBB',GradientType=0 );
}
如果有帮助,这里是 html:
<table style="width:100%" cellpadding="0" cellspacing="0">
<thead class="header">
<tr>
<th width="200px">Actor</th>
<th rowspan="3">Character</th>
</tr>
<tr>
<th>Gender</th>
</tr>
<tr>
<th>Age</th>
</tr>
</thead>
<tbody class="odd">
<tr>
<td width="200px">Test</td>
<td rowspan="3">Test</table>
</td>
</tr>
<tr>
<td>Male</td>
</tr>
<tr>
<td>25</td>
</tr>
</tbody>
</table>
最佳答案
在 thead 上设置 background-attachment:fixed;
就可以正常工作了
关于html - CSS:设置为 tbody/thead 时在 Chrome 中重复渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6356852/