兼容性

// 创建变量的书写格式 $变量名:属性值;
// 创建混合器(不带参)
@mixin F74 {display: flex;
justify-content: space-evenly;
align-items: center;

}
$bgc:red;
$bs:10px solid black;
header{
height: 200px;
background-color:$bgc;
nav{
border: 1px solid gold;
ul{
// 引用混合器
// @include + 类名
@include F74;
list-style-type: none;
li{
a:nth-child(2){
color: saddlebrown;
}
background-color: aqua;
a{
color:green;
text-decoration: none;
&:hover{color: red;


}
}
}
}

};
}
main{
height: 400px;
margin-top: 30px;
background-color: $bgc;
border: $bs;
}

posted @ 2021-06-27 12:35  彧老魔  阅读(296)  评论(0)    收藏  举报