nth-Child用法
.result-list li:nth-child(1) .ui-label {
background:#ff4527;
}
解释:.result-list下的第一个子元素li,下面的ui-label元素的背景色
<ul class="list result-list f-16"> <li ng-repeat="item in result.data"> <div class="clearfix"> <div class="go-left"> {{item.n}}</div> <div class="go-right"><span class="accout">{{item.c}}人</span><span class="percent">{{item.p}}%</span> </div> </div> <div id="process"> <div class="ui-bg"> <span style="width:{{item.p}}%" class="ui-label"></span> </div> </div> </li> </ul>
.result-list li:nth-child(4n-3) .ui-label {
background:#ff4527;
}
解释:.result-list下的第4n-3个子元素li,下面的ui-label元素的背景色