Select every other element of class using css3

后端 未结 3 648
夕颜
夕颜 2021-01-12 11:08

Given an ul with a structure like this:

  • ...
  • ...
3条回答
  •  春和景丽
    2021-01-12 11:42

    Basically, you can't with plain CSS3. The nth-child selectors work on element selectors, not classes. So, li:nth-child(even) works, but .product:nth-child(even) does not.

    You will need jQuery to achieve this.

提交回复
热议问题