CSS transition-duration Property

Let the transition effect last for 5 seconds:

div {
transition-duration: 5s;
}

Try it Yourself »


Definition and Usage

The transition-duration property specifies how many seconds (s) or milliseconds (ms) a transition effect takes to complete.

Default value: 0s
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.transitionDuration=”1s”Try it
CSS Syntax
transition-duration: time|initial|inherit;
Property Values
Value Description
time Specifies how many seconds or milliseconds a transition effect takes to complete. Default value is 0s, meaning there will be no effect
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit