1.按钮hover上去变色(渐变,从底部向上变)
.btn-item {
position: relative;
span {
z-index: 100;
position: relative;
}
}
.btn-item::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
display: block;
height: 0;
width: 100%;
transition: height .35s ease-in-out;
}
.btn-item:hover::after {
height: 100%;
background-color: #d10c1a;
border: 2px solid #d10c1a;
transition: height .35s ease-in-out;
}
2.回到顶部
2.1 html部分
<div class="to-top" id="scrollTop">
<span class="iconfont iconziyuan"></span>
</