Answers:
试试看:
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: #color;
}
这是通过grunt或其他任务运行器编译的bootstrap v4的
您需要更改$table-hover-bg
以将悬停设置为突出显示
$table-cell-padding: .75rem !default;
$table-sm-cell-padding: .3rem !default;
$table-bg: transparent !default;
$table-accent-bg: rgba(0,0,0,.05) !default;
$table-hover-bg: rgba(0,0,0,.075) !default;
$table-active-bg: $table-hover-bg !default;
$table-border-width: $border-width !default;
$table-border-color: $gray-lighter !default;
$table-hover-bg
,$table-active-bg
依此类推,不是$table-bg-...
。以为我疯了一分钟😅–
HTML代码:
<table class="table table-hover">
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Doe</td>
<td>john@example.com</td>
</tr>
<tr>
<td>Mary</td>
<td>Moe</td>
<td>mary@example.com</td>
</tr>
<tr>
<td>July</td>
<td>Dooley</td>
<td>july@example.com</td>
</tr>
</tbody>
CSS代码
.table-hover thead tr:hover th, .table-hover tbody tr:hover td {
background-color: #D1D119;
}
CSS代码指示:
将鼠标悬停在行上:
.table-hover> thead> tr:hover
th的背景色将更改为#D1D119
日
肢体也会发生相同的动作
.table-hover tbody tr:hover td
尝试:
.table-hover > tbody > tr.active:hover > th {
background-color: #color;
}
td
需要?(对不起,我在CSS方面一文不值,尝试学习)