sass的属性hover怎么写
在sass中,可以使用&符号来表示父元素,然后再加上:hover伪类即可。例如:
button {
background-color: #eee;
color: #333;
&:hover {
background-color: #333;
color: #eee;
}
}
编译后的CSS代码为:
button {
background-color: #eee;
color: #333;
}
button:hover {
background-color: #333;
color: #eee;
}
原文地址: https://www.cveoy.top/t/topic/b13K 著作权归作者所有。请勿转载和采集!