【发布时间】:2022-02-07 23:44:49
【问题描述】:
我的编码挑战有问题,我不允许在 css 中使用 :nth-child、+、~ 或数据目标。我也无法编辑 HTML。是否有任何解决方案可以在没有上述语法的情况下获取<section> 中的第二个元素?
感谢您的帮助
<article id="task-2">
<div class="marble"></div>
<section>
<div class="marble"></div>
<div class="marble" data-target></div>
</section>
<div class="marble"></div>
</article>
【问题讨论】:
-
:last-child(),:nth-last-child()
标签: html css css-selectors