The animation-name property

The animation-name property specifies an animation (or animations) name that will be applied to this element. The animation name must be the same as that specified when defining @keyframes.

Syntax

cssselector {
  animation-name: animation name;
}

Example

In this example the animation is named move:

html<div id="elem"></div>
css@keyframes move {
  from {
    margin-left: 0px;
  }
  to {
    margin-left: 400px;
  }
}

#elem {
  animation-name: move;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  border: 1px solid black;
  width: 50px;
  height: 50px;
}

Результат:

See also