如何使用 Bootstrap 的帮助 类 在 table 中设置 link 的样式?
How to style a link inside a table with Bootstrap's helping classes?
我确定这是一个很容易解决的问题,但我找不到正确的方法。
我有一个带有 Bootstraps 的网站(英雄-bootstrap 模板)。
我在 table 中有一个 link,但我无法将 "text-success" 之类的帮助 class 应用到 link。
检查fiddle:https://jsfiddle.net/9dt5zo74/2/
<div class="table-responsive">
<table class="table table-condensed table-hover table-striped text-center">
<thead>
<tr class="active">
<th class="text-center">text</th>
<th class="text-center">text</th>
<th class="text-center">text</th>
<th class="text-center">text</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="text-success" href="#">something should work and it doesnt</a></td>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
</tbody>
</table>
</div>
<p class="text-success">that works</p>
如您所见,class 适用于 table 之外的元素。
第 6400 行中的样式
table a:not(.btn),
.table a:not(.btn) {
color: #fff;
text-decoration: underline;
}
获得更高的优先级
我确定这是一个很容易解决的问题,但我找不到正确的方法。
我有一个带有 Bootstraps 的网站(英雄-bootstrap 模板)。
我在 table 中有一个 link,但我无法将 "text-success" 之类的帮助 class 应用到 link。
检查fiddle:https://jsfiddle.net/9dt5zo74/2/
<div class="table-responsive">
<table class="table table-condensed table-hover table-striped text-center">
<thead>
<tr class="active">
<th class="text-center">text</th>
<th class="text-center">text</th>
<th class="text-center">text</th>
<th class="text-center">text</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="text-success" href="#">something should work and it doesnt</a></td>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
</tbody>
</table>
</div>
<p class="text-success">that works</p>
如您所见,class 适用于 table 之外的元素。
第 6400 行中的样式
table a:not(.btn),
.table a:not(.btn) {
color: #fff;
text-decoration: underline;
}
获得更高的优先级