2017-03-29 50 views
0

我想在角度項目中選擇nth-of-type,但不能像所有元素都獲得父/包裝一樣。 E.g我想每一個第三個按鈕有標記:Angular2的CSS選擇器

<dashboard-functionbutton _ngcontent-tub-48="" _nghost-tub-49="" ng-reflect-function-button-item="[object Object]"> 
<button _ngcontent-tub-49="" class="function-btn" ng-reflect-ng-class="[object Object]"></button> 
</dashboard-functionbutton> 

如果這是不可能做到這種方式,是有可能的樣式「父」的東西,如[dashboard-functionbutton]

回答

0

CSS:

dashboard-functionbutton:nth-of-type(3n+0) > button { border: 1px solid red; }