我正在使用Bootstrap 3,我有一个显示一些数据的表.在这个表中我已经应用了一些javascript用于条件格式化,如果满足条件,我将元素的类设置为"红色"
.red {
background-color:red;
color:white;
}
Run Code Online (Sandbox Code Playgroud)
元素HTML如下:
<td class="red">0</td>
Run Code Online (Sandbox Code Playgroud)
我现在在文本颜色适用的奇数行上存在冲突,但背景颜色被引导程序中的以下css覆盖.
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个冲突,并确保红色班级能够进行优先考虑?