(css)css实现关闭按钮 :
<div class="right-title">
<span class="right-title-text">热门问答</span>
<span class="right-title-btn" @click="handleClose"></span>
</div>
// 关闭按钮
.right-title-btn {
position: relative;
margin: 3px;
width: 20px;
height: 20px;
cursor: pointer;
box-sizing: border-box;
}
.right-title-btn:before {
position: absolute;
content: "";
width: 2px;
height: 25px;
background: #fff;
transform: rotate(45deg);
top: -3px;
left: 11px;
}
.right-title-btn:after {
content: "";
position: absolute;
width: 2px;
height: 25px;
background: #fff;
transform: rotate(-45deg);
top: -3px;
left: 11px;
}
效果: