&:first-of-type含义

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;
}

原文地址:https://www.cnblogs.com/yangai/p/9700181.html