Home > Web Front-end > Front-end Q&A > How to use css animation-delay property

How to use css animation-delay property

藏色散人
Release: 2019-05-29 09:11:41
Original
3616 people have browsed it

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;
Copy after login

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template