我正在尝试section从第四个标签中选择每个第三个标签。因此,以下粗体元素将指示我要选择的那些元素:
我尝试了以下代码,但似乎无法正常工作
section:nth-child(3n+1)
Run Code Online (Sandbox Code Playgroud)
如果要从第4个元素开始,请+4不要+1
section:nth-child(3n+4) {
color: red;
}Run Code Online (Sandbox Code Playgroud)
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>
<section>Section</section>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
919 次 |
| 最近记录: |