css中的&符号作用是什么呢
之前遇到样式&符号一直很疑惑,查了相关资料,知道了其作用
列子如下
clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
具体解析之后就是
& 表示在嵌套层次中回溯一层,即
&:before相当于.clearfix :before
&:after相当于.clearfix :after
之前遇到样式&符号一直很疑惑,查了相关资料,知道了其作用
列子如下
clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
具体解析之后就是
& 表示在嵌套层次中回溯一层,即
&:before相当于.clearfix :before
&:after相当于.clearfix :after
4939
782
1408

被折叠的 条评论
为什么被折叠?