Home  >  Article  >  Web Front-end  >  How to use css animation-delay property

How to use css animation-delay property

藏色散人
藏色散人Original
2019-05-29 09:11:413592browse

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 css animation-delay property

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:

How to use css animation-delay property

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn