Home > Article > Web Front-end > How to use css animation-delay property
css animation-delay property defines when the animation starts. The basic syntax is: animation-delay: time. The time value is measured in seconds (s) or milliseconds (ms); negative values are allowed.
How to use the css animation-delay property?
The animation-delay attribute defines when the animation starts. The basic syntax is: animation-delay: time. The time value is measured in seconds (s) or milliseconds (ms); negative values are allowed, for example: -2s causes the animation to start immediately, but skips 2 seconds to enter the animation.
Function: The animation-delay attribute defines when the animation starts. animation-delay value is in seconds or milliseconds.
Syntax:
animation-delay: time;
Description: time Optional. Defines the time, in seconds or milliseconds, to wait before the animation starts. The default value is 0, negative values are allowed, for example: -2s causes the animation to start immediately, but skips 2 seconds to enter the animation.
Note: Internet Explorer 9 and earlier versions do not support the animation-delay attribute.
css animation-delay property example
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; position:relative; animation:mymove 5s infinite; animation-delay:2s; /*Safari and Chrome*/ -webkit-animation:mymove 5s infinite; -webkit-animation-delay:2s; } @keyframes mymove { from {left:0px;} to {left:200px;} } @-webkit-keyframes mymove /*Safari and Chrome*/ { from {left:0px;} to {left:200px;} } </style> </head> <body> <p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-delay 属性。</p> <div></div> </body> </html>
Effect output:
The above is the detailed content of How to use css animation-delay property. For more information, please follow other related articles on the PHP Chinese website!