<div class="animation"></div>
@keyframes primaanimazione {
  from {
    background-color: red;
  }
  to {
    background-color: green;
  }
}

.animation {
  width: 200px;
  height: 200px;
  background-color: red;

  animation-name: primaanimazione;
  animation-duration: 4s;
  animation-iteration-count: infinite;
  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.