第一种方法:使用not选择器    :not(:first-child)

div:not(:first-child){
    display: flex;
}

第二种方法:使用nth-of-type选择器,与第一种类似,只不过多了元素类型

第三种方法:使用nth-child选择器(匹配div父元素的第2个及之后的子元素)

div:nth-child(n+2){
    display: flex;
}

 

相关文章:

  • 2021-12-28
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2021-11-24
  • 2021-12-24
  • 2021-09-07
  • 2021-12-28
  • 2021-12-28
相关资源
相似解决方案