鼠标移入时:
鼠标移出时:
实现:
<div class="father">
<button class="son">我是按钮</button>
</div>
.father{
background-color: burlywood;
height: 30px;
&:hover .son{
display: block; // 设置父元素hover时子元素的样式 【实现要点!!!!!】
}
}
.son{
background-color: cadetblue;
height: 20px;
float: left; // 让按钮浮动在父元素上
display: none;
}