nth-child with mod (or modulo) operator

后端 未结 5 1684
忘了有多久
忘了有多久 2020-12-16 13:10

Is it possible to use the nth-child with modulo? I know you can specify a formula, such as

nth-child(4n+2)

But I can\'t seem t

5条回答
  •  囚心锁ツ
    2020-12-16 13:28

    If you want modulous with n=2 than you can use even or odd.

    tr:nth-child(even) {
      background-color: #ffffdffffd;
    }
    

提交回复
热议问题