我遇到了一个我不明白的麻烦。 我想要所有 TR 的相同悬停,正确的是在 CELL B 上工作的悬停
谁能解释一下,错误在哪里?
这是我的悬停 CSS:
.table-hover tr:hover,
.table-hover tr td:hover {
background-color: #595959!important;
color: #fff;
font-style: italic;
}
最佳答案
你的问题是这样的:
.table-striped>tbody>tr:nth-child(odd)>td,
.table-striped>tbody>tr:nth-child(odd)>th{
background-color: #f9f9f9!important;
}
你的风格没有覆盖这个,注意 fiddle 我也改变了:
.table-hover tr td:hover
为此:
.table-hover tr:hover td
因为您想更改 :hovered TR.. 下的所有 TD,对吧?
关于html - 如何使与其他 tr 相同的悬停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24285314/