<div class="box none">None</div>
<div class="box forwards">Forwards</div>
<div class="box backwards">Backwards</div>
<div class="box both">Both</div>
.box {
  width: 100px;
  height: 100px;
  margin: 20px;
  background-color: yellow;
  animation: move 2s ease-in-out 3s;
}

.none {
  animation-fill-mode: none;
}

.forwards {
  animation-fill-mode: forwards;
}

.backwards {
  animation-fill-mode: backwards;
}

.both {
  animation-fill-mode: both;
}

@keyframes move {
  from {
    transform: translateX(0);
    background-color: #3498db;
  }
  to {
    transform: translateX(300px);
    background-color: #e74c3c;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.