I am making a circle shrinking and growing with the keyframes animation kit. I've gived my div a margin-left: 45vw, and margin-top: 45vh. This obviously makes the circle not being centered all of the time as the size of the circle varies. Is there anything I can add to my code so that the center of the circle always stays at the middle of the screen?
<!DOCTYPE html>
<html>
<style>
#ball {
width: 100px;
height: 100px;
margin-left: 45vw;
background-color: purple;
border-radius: 50%;
animation-name: sprett;
animation-duration: 5s;
animation-iteration-count: infinite;
}
@keyframes sprett {
40% {
width: 25px;
height: 25px;
}
50% {
width: 100px;
height: 100px;
}
90% {
width: 175px;
height: 175px;
}
100% {
width: 100px;
height: 100px;
}
}
</style>
<body>
<div id="ball"></div>
</body>
</html>