2016-07-28 30 views
0

我正在使用可排序的ng-table來顯示一些數據。 每列都有一個排序標題。 (這是內部的<div>一個<th class="sortable">ng-table的可排序頭選擇器

如果我嘗試選擇使用

th.sortable > div:nth-child(1) 

它選擇每個<th>

我分叉現有小提琴和加入一個塊內的所有的div第一集管在CSS窗格的頂部。

http://fiddle.jshell.net/7mom2ar0/

回答

1
th.sortable:nth-child(1) > div:nth-child(1) { 
    background-color: red; 
} 

這樣使用它,如果你想第一選擇爲<th> 可以這樣做也。 :http://fiddle.jshell.net/bxhcu50a/

th.sortable:first-child > div:first-child { 
    background-color: red; 
}