Repeat a CSS Animation with just CSS.

.animate {
  animation-duration: 3s;
  animation-name: slidein;
  animation-iteration-count: infinite;
}

.circle {
  height: 30px;
  width: 30px;
  background-color: red;
  border-radius: 50%;
  display: inline-block;
}

@keyframes slidein {
  from {
    margin-left: 100%;
    width: 300%;
  }

  to {
    margin-left: 0%;
    width: 100%;
  }
}


  

See the Pen Untitled by Devtutorials4u (@devtutorial4u) on CodePen.

Categorized in: