span {
    &:first-of-type {
        margin-right: 16px;
    }
}

&符号是scss和less里的语法,代表上一级选择器,实际编译成css就是

span:first-of-type{
}

CSS3 first-of-type 选择器:

实例:指定父元素的首个 p 元素的背景色:

p:first-of-type
{
background:#ff0000;
}

&:first-of-type含义

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-11-22
  • 2021-11-18
  • 2022-12-23
  • 2021-07-20
猜你喜欢
  • 2021-10-07
  • 2021-04-13
  • 2021-07-08
  • 2021-12-28
  • 2021-11-07
  • 2022-02-24
  • 2021-06-11
相关资源
相似解决方案