nth-child(odd):奇数

nth-child(even):偶数

使用时,如果是精确到数字时,切记是从同一级别的元素开始计算,而不是指定某个类才开始计算。

比如:

<li></li>

<li class="test"></li>

<li></li>

如果我要选择class为test的,nth-child(2),第2个。

详细解释,参考:

http://niutuku.com/tech/css/249737.shtml

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-06-25
  • 2021-11-03
  • 2021-10-27
猜你喜欢
  • 2021-08-12
  • 2021-12-06
  • 2022-01-08
  • 2021-11-09
相关资源
相似解决方案