【发布时间】:2016-03-24 20:40:24
【问题描述】:
有没有办法将任何类的&:hover 扩展到任何其他类的悬停?
我的代码是这样的,它停止了两个类的悬停:
HTML
<a href="#" class="button1">Button 1</a>
<a href="#" class="button2">Button 2</a>
SCSS
.button1 {
background: black;
padding: 5px 10px;
text-decoration: none;
color: white;
&:hover {
background: red;
}
}
.button2 {
background: blue;
padding: 5px 10px;
text-decoration: none;
color: white;
&:hover {
@extend .button1:hover
}
}
【问题讨论】: