Propiedad animation-name

La propiedad animation-name establece el nombre de la animación (o animaciones) que se aplicará a este elemento. El nombre de la animación debe ser el mismo que se definió al establecer los fotogramas clave @keyframes.

Sintaxis

cssselector {
  animation-name: nombre-de-animación;
}

Ejemplo

En este ejemplo, la animación tiene el nombre 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;
}

Результат:

Véase también