【发布时间】:2013-09-30 14:35:34
【问题描述】:
我正在尝试使用 Bootstrap 为上下文 TR 着色创建一些自定义类。
阅读它说找到将类属性复制到 custom.css 文件并修改它以满足您的需要的文档。然而,在尝试这个没有成功之后,我想我会把我的自定义类添加到 bootstrap.css 中。仍然没有成功。
我一直在尝试使用 Firebug 诊断问题,但未能找到解决方案,因此在此处发帖。
当我使用类元素“成功”时,CSS 看起来像这样
.table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tbody:last-child tr:last-child > th:first-child, .table-bordered tfoot:last-child tr:last-child > td:first-child, .table-bordered tfoot:last-child tr:last-child > th:first-child {
border-bottom-left-radius: 4px;
}
.table tbody tr.success > td {
background-color: #DFF0D8;
}
.table-striped tbody > tr:nth-child(2n+1) > td, .table-striped tbody > tr:nth-child(2n+1) > th {
background-color: #F9F9F9;
}
当我使用我的自定义类(我可以看到在 Firebug 中选择了它)时,我明白了。
.table-striped tbody > tr:nth-child(2n+1) > td, .table-striped tbody > tr:nth-child(2n+1) > th {
background-color: #F9F9F9;
}
所以它甚至没有从 CSS 文件中读取自定义类,我不知道为什么。
有什么想法吗?
S
编辑 **
自定义 CSS 文件如下所示。
.width100{
width: 100%;
}
/*Custom Table Row Property*/
.table-striped> tbody tr.major > td {
background-color: #faa732;
}
.table tbody tr.initial > td {
background-color: #49afcd;
}
.table tbody tr.maint > td {
background-color: #5b331d;
}
.table tbody tr.suppressed > td {
background-color: #bfcada;
}
【问题讨论】:
-
您的自定义类中的 css 是什么样的?
-
这个问题似乎是题外话,因为问题是由浏览器缓存引起的。过于本地化。
标签: jquery html css twitter-bootstrap