If you hover your mouse under the text but inside the div, the animation will be interrupted mid way and makes this glitchy "animation" where the element keeps on switching between from being animating and not animated.
@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>
This is a problem when the user goes past a button too quickly, so how do I fix this?