2017-03-29 44 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; }