灰烬把手与adjacent sibling CSS选择器(el + el
)灰烬车把和相邻的CSS选择器
例如搞乱,我有一个项目清单:
{{#each item in items}}
<span class="item">{{item}}</span>
{{/each}}
而且我想这两者之间添加间距规则:
.item + .item {
margin-left: 1em;
}
但它不工作,因为灰烬中插入项目之间的Metamorph占位符(标签,如<script id="metamorph-1-end" type="text/x-placeholder"></script>
)
我应该用什么来代替相邻的同级选择器和把手?
这不会让你选择直接兄弟像邻近的选择:HTTP ://www.w3.org/TR/CSS2/selector.html#adjacent-selectors –
是的,它具有不同的语义,但通常不重要。如果它很重要,还有另一种解决方案 –