如果将鼠标悬停在文本下方,但在div内,动画将在中途中断,并使该元素在动画和非动画之间不断切换,从而使该元素成为一个闪烁的"动画".
@keyframes hover {
0% {bottom: 0px; border-radius: 0%;}
100% {bottom: 100px; border-radius: 10%;}
}
body {
display: flex;
justify-content: center;
align-items: center;
}
#i {
transition: 0.5s ease;
position: relative;
display: flex;
justify-content: center;
align-items: center;
background-color: rgb(255, 100, 0);
width: 200px;
height: 200px;
font-size: 50px;
text-align: center;
font-family: sans-serif;
bottom: 0px;
}
#i:hover {
position: relative;
cursor: pointer;
animation: hover 0.5s ease;
bottom: 100px;
border-radius: 10%;
}
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div id="i"><strong>Hover</strong></div>
</body>
</html>
这是一个问题,当用户通过一个按钮太快,那么我该如何解决这个问题?