CSS transition-delay Property
Example
div {
transition-delay: 2s;
}
Hover me!
Meaning
The transition-delay property specifies the duration to wait before starting a property's transition effect when its value changes.
Default value: | 0s |
Inherited: | No |
Animatable: | No |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
transition-delay: time|initial|inherit|revert|revert-layer|unset;
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Status
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
time | Denotes the amount of time to wait between a property's value changing and the start of the transition effect. |
initial | Sets this property to its default value. |
inherit | If specified, the associated element takes the computed value of its parent element animation-delay property. |
revert | Reverts the cascaded value of the property from its current value to the value the property |
revert-layer | Rollback styles to the ones specified in previous cascade layers. |
unset | Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. |
Default CSS Property Values
selectors {
transition-delay: 0s;
}
More Examples
The following example show how to set all transition properties using shorthand property:
Example
div {
width: 100px;
height: 100px;
background: red;
transition: width 2s ease-in-out 2s;
}
- transition-property: width
- transition-duration: 2s
- transition-timing-function: ease-in-out
- transition-delay: 2s
The following element combines transitions for: border, width, height, background-color, transform. Hover over the red div element to see these properties animated.
Hover me!
Example
div {
border: 1px solid;
width: 100px;
height: 100px;
background-color: red;
transition: border 5s, width 2s, height 2s, background-color 2s, transform 2s;
}
div:hover {
border: 10px solid;
background-color: #0069FF;
width: 200px;
height: 200px;
transform: rotate(180deg);
}