【发布时间】:2016-07-25 03:41:17
【问题描述】:
我发现以下 CSS 类句柄突出显示 dataTables 中的活动行。
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #337ab7;
}
产生这样的结果:
最左边的列是一个链接,可以看出这对我的链接样式有什么影响。当前链接是默认的蓝色,我想将其更改为白色。是否可以直接在此类中设置我的链接样式?
Bob Rhodes 给出了正确的答案。
.table > tbody > tr.active > td > a {color: white}
再次感谢。
【问题讨论】:
-
在标准 css 中你不能嵌套规则。但是,如果您需要根据所选内容为您的 a 标签设置特定样式,您可以使用
tr.active a {color: #666;}例如。 -
很抱歉,我不太明白这会如何影响您的链接样式,因为您还没有告诉我们您希望链接的样式。那么,你能告诉我们吗?但是,是的,这是可能的。你想做什么?
-
BobRodes,我编辑了原始提示,说我想在突出显示时将链接设置为白色。
-
我正在阅读您的原始示例,因为顶部的蓝线是标题!难怪我一头雾水。哈哈
标签: jquery css datatables