Home  >  Article  >  Web Front-end  >  How to use transition-delay attribute

How to use transition-delay attribute

青灯夜游
青灯夜游Original
2019-02-01 13:30:504236browse

The transition-delay attribute specifies when the switching effect will start. Its value is in seconds (S) or milliseconds (ms).

How to use transition-delay attribute

CSS3 transition-delay property

Function: transition The -delay attribute specifies when the transition effect begins. The transition-delay value is in seconds or milliseconds.

Syntax:

transition-delay: time

Description: time specifies the time to wait before the transition effect starts, measured in seconds or milliseconds.​

Note: Internet Explorer 9 and earlier browsers do not support the transition-delay attribute; Internet Explorer 10, Firefox, Opera and Chrome support the transition-delay attribute. Safari supports an alternative -webkit-transition-delay property.

Usage example of CSS3 transition-delay property

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style> 
div
{
width:100px;
height:100px;
background:blue;
transition-property:width;
transition-duration:5s;
transition-delay:2s;
/* Firefox 4 */
-moz-transition-property:width; 
-moz-transition-duration:5s;
-moz-transition-delay:2s;
/* Safari and Chrome */
-webkit-transition-property:width; 
-webkit-transition-duration:5s;
-webkit-transition-delay:2s;
/* Opera */
-o-transition-property:width;
-o-transition-duration:5s;
-o-transition-delay:2s;
}
div:hover
{
width:300px;
}
</style>
</head>
<body>
<p>请把鼠标指针移动到蓝色的 div 元素上等待两秒钟,查看过渡效果。</p>
<div></div>
<p><b>说明:</b>过渡效果会在开始前等待两秒钟。</p>
<p><b>说明:</b>本例在 Internet Explorer 中无效。</p>
</body>
</html>

Rendering:

How to use transition-delay attribute

The above is the entire content of this article, I hope it will be helpful to everyone's study. For more exciting content, you can pay attention to the relevant tutorial columns of the PHP Chinese website! ! !

The above is the detailed content of How to use transition-delay attribute. 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