Web4College

CSS transition-duration property

src

Description

CSS transition-duration defines the time duration for a value change to occur as a result of some user event such as :hover, :active, and :link.


Negative values are not allowed. In the following demo, the transition occurs within a specific duration (transform property change occurs).

Syntax

animation-duration : time

Property values

+ve value (seconds)Default

0

It determnines the duration of transition. transition occurs instantly for 0s.

transition-duration: 0s;
Try it

+ve value (seconds)

2.5

transition-duration also accepts fractional values. Change in the property value occurs within 2.5s.

transition-duration: 2.5s;
Try it

+ve value (milliseconds)

2000

time in milliseconds may also be used as the value. 2000ms means 2s.

transition-duration: 2000ms;
Try it

Applicable to

It applies to all elements