更新时间:2023-01-24 13:02:58
那是 LESS,而不是 CSS.
That's LESS, not CSS.
此语法允许您嵌套选择器修饰符.
This syntax allows you to nest selector modifiers.
.clearfix {
&:before {
content: '';
}
}
将编译为:
.clearfix:before {
content: '';
}
使用&
,嵌套选择器编译为.clearfix:before
.
没有它,他们编译为 .clearfix :before
.
With the &
, the nested selectors compile to .clearfix:before
.
Without it, they compile to .clearfix :before
.