Question
let's if i have the following example
A-------------B------------C how i can start an animation from the middle ( B ) then it go to A then to B and finaly it go to C , i made an example but it's not working good.
Code
.container { display: block; } .container .line { display: block; height: 1px; width: 400px; background: red; } .line:after{ content: ""; height: 20px; width: 20px; display: block; background: black; border-radius: 50%; position: absolute; left: 200px; top: 0px; } @keyframes move { 0% { left: 200px; } 25%{ left: 0px; } 100%{ left: 400px; } } .line:after { -webkit-animation: move 1s alternate infinite; -moz-animation: move 1s alternate infinite; -ms-animation: move 1s alternate infinite; -o-animation: move 1s alternate infinite; animation: move 1s alternate infinite; } <div class="container"> <div class="line"></div> </div>