为什么css3:nth-​​child(4n)计数不正确

时间:2014-06-10 01:14:07

标签: html css

enter image description here我的目标是每一行有四列我使用:nth-child但不能正常工作,因为我预计只能在第一行工作,第二行边界div在第三列。< / p>

HTML

    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>

    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>
    <div class="workplace">some text here</div>

    <div class="workplace">some text here</div>

css

 .workplace:nth-child(4n){
    border:1px solid red;
    }

我的问题是:为什么会发生这种情况是因为其他风格的冲突?

0 个答案:

没有答案