Propiedad animation-delay

La propiedad animation-delay establece el retraso antes del inicio de la animación.

Sintaxis

cssselector {
  animation-delay: tiempo en s o ms;
}

Valores

Valor Descripción
s Especifica el tiempo en segundos (por ejemplo 3s).
ms Especifica el tiempo en milisegundos (por ejemplo 3ms). Un segundo equivale a 1000 milisegundos.

Valor por defecto: 0s.

Ejemplo

En este ejemplo, habrá un retraso de 3 segundos antes del inicio de la animación:

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

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

Результат:

Véase también