Your code has been successfully adjusted with reference to the examples provided on developer.mozilla.org. I trust that this aligns with the anticipated outcome.
By utilizing
animation-iteration-count: infinite;
, the animation will continue to loop indefinitely.
The attribute animation-name
specifies the identifier used within @keyframes.
Moreover, animation-duration
indicates the duration in seconds or milliseconds required for the animation's completion.
To delve deeper into this topic, please refer to https://www.w3schools.com/cssref/css3_pr_animation.asp.
#block{
width: 20px;
height: 20px;
background-color: blue;
position: absolute;
top: 130px;
left: 480px;
animation-duration: 3s;
animation-name: block;
animation-iteration-count: infinite;
}
@keyframes block {
0% {
left: 480px;
}
100% {
left: -40px;
}
}
<div id="block"></div>