从表格的某一行删除表格悬停效果?

时间:2014-09-15 11:55:19

标签: html css twitter-bootstrap

这是html:

<table class="table table-striped table-bordered table-condensed table-hover">
    ....
    </tr>
    <tr ng-repeat-end ng-show="modelRow.activeRow==car.name" class="hidden-table">
        <td colspan="6">
            <table class="table table-striped table-bordered table-condensed table-hover">
                <tr><td>{{car.name}}</td><td>{{car.review}}</td><td>{{car.rating}}</td><td>{{car.recommended}}</td></tr>
                <tr><td>{{car.name}}</td><td>{{car.review}}</td><td>{{car.rating}}</td><td>{{car.recommended}}</td></tr>
                <tr><td>{{car.name}}</td><td>{{car.review}}</td><td>{{car.rating}}</td><td>{{car.recommended}}</td></tr>
            </table>
        </td>
    </tr>
</tbody>

这是一个隐藏的行,其中包含一个html表,当你点击表格的某一行时就会显示出来。

但是当我的隐藏桌子出现在一行并且你指向它上面的鼠标时,它会改变背景颜色,但我不需要那样。我试图通过以下css解决这个问题:

 .hidden-table:hover {
     background-color: none !important;
 }

但它没有用。 那么,从表格的某一行中删除表格悬停效果的正确方法是什么?

2 个答案:

答案 0 :(得分:3)

background-color: none;不存在......它应该是透明的。但这不会对你有用,因为你将拥有tr的颜色......

所以你必须设置一个颜色:

.hidden-table:hover {
     background-color: white !important;
 }

编辑:

由于您的表还具有引导类table-hover和其他,您必须覆盖此属性:

.table-hover > tbody > tr:hover > td

类似于:

.table-hover > tbody > tr.hidden-table:hover > td {
     background-color: white;
 }

答案 1 :(得分:1)

  

这对我来说非常适合我

table tr:hover td { 
   background-color: inherit;     
   opacity: 1.0;
}