当您将鼠标悬停在图像上时,蓝色箭头缓慢移动。当您将光标从图像上移开时,白色箭头会急剧返回。如何让白色箭头缓慢返回?
@keyframes left_to_right {
from {margin-left: -15px;}
to {margin-left: 0; }
}
div .footer-text{
position: absolute;
top: 10%;
left: 3%;
height: 20px;
width: 85%;
}
div .footer-text:after{
content: '';
background: url('https://www.nsartmuseum.ru/images/test/arrow-after-3.png') no-repeat;
width: 130px;
height: 15px;
display: inline-block;
margin-left: 10px;
position: relative;
}
div:hover .footer-text:before{
content: '';
background: url('https://www.nsartmuseum.ru/images/test/arrow-before-3.png') no-repeat;
width: 130px;
height: 15px;
margin-right: 5px;
display: inline-block;
animation: left_to_right 0.4s ease;
}
div:hover .footer-text:after{
content: '';
background: none;
}
div .footer-text span{
position: relative;
top:-5px;
font-size: 12px;
color: #313B78;
display: inline-block;
}
<div>
<a href="" class='footer-text'>
<span>13 September</span>
</a>
</div>
显然,有很多方法可以通过 CSS 动画来做到这一点,但我从未在开发中使用过它。
森栏
MMTTMM
FFIVE
相关分类