【发布时间】:2018-10-28 15:04:22
【问题描述】:
如何使用:nth-child()选择器只选择前三个元素?
section > figure:nth-child( ? ) {
/* ... */
}
<section>
<figure>1</figure> <!-- select this -->
<figure>2</figure> <!-- and this -->
<figure>3</figure> <!-- and this -->
<figure>4</figure>
<figure>5</figure>
<figure>6</figure>
</section>
【问题讨论】:
标签: html css css-selectors