kyo*_*kyo 5 html css twitter-bootstrap
我使用bootstrap表类.默认边框颜色是灰色/银色 - 我想.
但我想将边框颜色更改为红色,但我无法使其工作.
这就是我所拥有的
.table {
border: red solid 1px !important;
}
Run Code Online (Sandbox Code Playgroud)
<table class="table table-bordered piechart-key ">
<thead >
<th></th>
<th></th>
<th> Item Summary</th>
<th> Item List</th>
</thead>
<tbody>
<tr>
<td width="30"></td>
<td width="200">
> 50% of students answered these items correctly
</td>
<td width="50">5/25</td>
<td width="100">5,10,15,19,23</td>
</tr>
<tr>
<td width="30"></td>
<td width="200">50% up to 75% of students answered these items correctly</td>
<td width="50">8/25</td>
<td width="100">3,7,11,13,14,16,21,22</td>
</tr>
<tr>
<td width="30"></td>
<td width="200">≥ 75% of students answered these items correctly</td>
<td width="50">12/25</td>
<td width="100">1,2,4,6,8,9,12,17,18,20,24,25</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
更改引导程序表的边框颜色的最佳方法是什么?
尝试将其应用于单元格:
.table td{
border: red solid 1px !important;
}
Run Code Online (Sandbox Code Playgroud)
对于标题:
.table th{
border: red solid 1px !important;
}
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/w0b73dwt/7/
编辑
OBS:我使用了!important指令,因为我找不到其他简单的方法.当然,我们都知道这是一个糟糕的CSS实践,但在某些情况下,我们将不得不承担风险. 另一种方法是找到bootstrap如何声明其样式并为td和th创建一个具有更高优先级的css选择器.在这种情况下,这可能会在第一次引导更新时中断.