<div id="ball1"></div>
<div id="ball2"></div>
<div id="ball3"></div>
<div id="ball4"></div>
@keyframes move {
  from {
    left: 0px;
  }
  to {
    left: 1000px;
  }
}

div {
  height: 100px;
  width: 100px;
  background: orange;
  border-radius: 50%;
  margin: 10px 0;
  position: relative;
  animation-name: move;
  animation-duration: 5s;
  animation-iteration-count: infinite;
}

#ball1 {
  animation-direction: normal;
}
#ball2 {
  animation-direction: reverse;
}
#ball3 {
  animation-direction: alternate;
}
#ball4 {
  animation-direction: alternate-reverse;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.