补充122836356
ul {margin-bottom: 20px;& > li {margin-bottom: 0;}
}等效于ul {margin-bottom: 20px;
}ul > li {margin-bottom: 0;
}
CSS中的&代表的什么
如源码:
ul{
margin-bottom: 20px;
& >li {
margin-bottom: 0;
}
}
& 表示嵌套的上一级
这是sass的语法,代表上一级选择器
解释成CSS代码如下
ul{margin-bottom: 20px;}
ul > li {margin-bottom: 0;}
————————————————
版权声明:本文为CSDN博主「nanhooo」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/nanhooo/article/details/122836356