My animation is currently moving in a square motion. However, I want it to move from the left side of the screen to the right side and back again on an infinite loop. Can anyone help with this?
.animation {
width: 10px;
height: 10px;
background-color: red;
position: relative;
animation-name: example;
animation-duration: 4s;
}
@keyframes example {
0% {
background-color: red;
left: 0px;
top: 0px;
}
25% {
background-color: red;
left: 200px;
top: 0px;
}
50% {
background-color: red;
left: 200px;
top: 200px;
}
75% {
background-color: red;
left: 0px;
top: 200px;
}
100% {
background-color: red;
left: 0px;
top: 0px;
}
}
<div class="animation"></div>