Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在余烬应用程序中定位第n个孩子时出现问题_Css_Ember.js_Css Selectors - Fatal编程技术网

Css 在余烬应用程序中定位第n个孩子时出现问题

Css 在余烬应用程序中定位第n个孩子时出现问题,css,ember.js,css-selectors,Css,Ember.js,Css Selectors,我正在开发一个余烬应用程序,由于余烬脚本标签,我必须使用错误的数字来定位第n个孩子。有没有一种可靠的方法可以在Ember应用程序中使用CSS将N个孩子作为目标 因此,不是: .league li:nth-child(1) h3::after { color: #eec600; } .league li:nth-child(2) h3::after { color: #b0b0b0; } .league li:nth-child(3) h3::after { color: #ae7435; }

我正在开发一个余烬应用程序,由于余烬脚本标签,我必须使用错误的数字来定位第n个孩子。有没有一种可靠的方法可以在Ember应用程序中使用CSS将N个孩子作为目标

因此,不是:

.league li:nth-child(1) h3::after { color: #eec600; }
.league li:nth-child(2) h3::after { color: #b0b0b0; }
.league li:nth-child(3) h3::after { color: #ae7435; }
我必须做:

.league li:nth-child(3) h3::after { color: #eec600; }
.league li:nth-child(6) h3::after { color: #b0b0b0; }
.league li:nth-child(9) h3::after { color: #ae7435; }

您可以尝试使用
:nth-of-type()
过滤掉脚本标记

如果需要使用
nth-child()
,那么应该使用

Ember.js 1.8.0-beta不再向dom中插入脚本标记,因此使用
nth-child()
应该不会有问题


如果您使用的是
ember cli
,则可以运行
bower install ember#1.8.0-beta.3--保存
以在项目中使用beta版

错误的数字?你是说奇怪?查看
div:nth child(odd){…}
将近4k,您仍然没有为这样的问题包含一些代码片段。。。使用…@NicoO匆忙-添加片段:-)谢谢。我试试那个版本。