English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
transition-The 'delay' CSS property defines when the transformation should start (for example, one2The 's' value indicates that the transformation will take effect in the application2seconds after). The value of this attribute can be specified as seconds or milliseconds.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | 0s |
---|---|
Applicable to: | All elements ::before and ::after Pseudo-element |
Inheritance: | None |
Animatable: | No.Please see Animation attributes. |
Version: | CSS3new feature |
JavaScript syntax: | object.style.transitionDelay="3s" |
The syntax of this attribute is as follows:
transition-delay: time | initial | inherit
The following example demonstrates how to use transition-delay attribute.
button { background: #fd7c2a; /* For Safari 3.0+ */ -webkit-transition-property: background; -webkit-transition-duration: 4s; -webkit-transition-delay: 2s; transition-property: background; transition-duration: 4s; transition-delay: 2s; } button:hover { background: #3cc16e; }Test to see‹/›
Note:This attribute allows negative values. However, it seems to have started in the middle of the transition cycle, for example-2The transition delay of s makes the transition start immediately, but after the transition starts2seconds start.
The following table describes the value of this attribute.
Value | Description |
---|---|
time | Define the number of seconds or milliseconds to wait before the transition starts. The default value is 0s. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts its parent element's transition-The value of delay attribute. |
transition-The compatibility of delay attribute in browsers, the numbers in the following table represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS3 Transitions.
Related attributes:transition,transition-duration,transition-property,transition-timing-function.