我用Twitter Bootstrap css文件搅拌了一张 table . 该表的定义如下:
<table class="table table-striped table-bordered table-hover">
...
</table>
使用jQuery我在表行的按钮上添加了一个名为“.red-background”的类 .
.red-background
{
background-color: red !important;
color: white !important;
}
问题是代码在对行上工作正常,但不是奇怪的!我不知道为什么,但删除表的类“table-striped”和“table-hover”,一切正常 . “红色背景”类中定义的“颜色”规则有效,但奇数行上的“背景颜色”没有 .
2 回答
找到一个有效的答案here:
在CSS中添加一个专门覆盖条带化规则的类,并将其添加到其他CSS规则下 . 对于您的示例,这是标记 .
使用此CSS类
希望能奏效 .