【发布时间】:2019-03-25 10:45:37
【问题描述】:
我试图让这个code 暂停动画,并且在我悬停在div 上时完成后不回弹。当我悬停在它上面时,我希望它保持一个正方形。
我四处搜索,发现 this 是一种暂停悬停,但不能转换为我的代码。
/*HTML*/
<div class="pers">
/*CSS*/
.pers{
margin-bottom: -4px;
width: 300px;
height: 300px;
display: inline-block;
background-color: green;
clip-path: polygon(50% 52%, 100% 0, 100% 100%, 0% 100%);
}
.pers:hover{
animation: polygons 1s;
animation-fill-mode: forwards;
}
@keyframes polygons {
75%
{
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}
}
【问题讨论】:
标签: html css css-animations keyframe clip-path