[英]CSS use not for TH hover in table TR
In table
I'm using this below CSS for highlight tr
s and I want to use :not
for th
在
table
,我用下面的CSS突出这一tr
S和我想要使用:not
针对th
HTML: HTML:
<table>
<thead>
<th></th>
<th></th>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
CSS: CSS:
table tr:hover {
background-color:#fff;
}
table th:hover {
background-color:none !important;
}
Scope the selector to the tbody
, not the thead
. 将选择器的范围调整为
tbody
,而不是thead
。
tbody tr:hover {
background-color:#fff;
}
tbody th:hover {
background-color:none !important;
}
HTML: HTML:
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.