273 of 313 menu

The animation-delay property

The animation-delay property sets a delay before an animation starts.

Syntax

selector { animation-delay: time in s or ms; }

Values

Value Description
s Specifies a time in seconds (e.g. 3s).
ms Specifies a time in milliseconds (e.g. 3ms). One second is 1000 milliseconds.

Default value: 0s.

Example

In this example, there will be the delay of 3 seconds before an animation starts:

<div id="elem"></div> @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; }

:

See also

byenru