【发布时间】:2016-08-22 12:43:56
【问题描述】:
我正在使用以下样式在我的页面中将 div 显示为偶数组合: css:
.task-container:nth-child(even) {
background: none;
}
.task-container:nth-child(odd) {
background: rgba(2, 104, 144, .05);
}
.timeout {
background-color: #ffc;
}
在 HTML 中。我在ng-repeat 中使用div:
<div class="task-container">
... other divs
</div>
在某些情况下,我想将背景颜色更改为黄色,但它不能作为 nth-child(even)/odd 覆盖黄色。我尝试了类似的方法:
<div class="task-container" data-ng-class="{'timeout': alarm.timeOutOccured== true}">
有人可以帮我找到正确的方法吗?
【问题讨论】:
标签: javascript angularjs css