CSS transition-duration
transition-duration is a CSS property that specifies the duration of a CSS transition. Transitions are CSS animations that occur when a CSS property changes value. The transition-duration property determines how long the transition will take to complete, in seconds (s) or milliseconds (ms).
Let's take a look at how transition-duration works with some examples.
Example 1: Basic Usage
In this example, we have a .box element that will transition its width property over 1 second when hovered over.
Example 2: Multiple Properties
In this example, the .box element will transition its width, height, and background-color properties over 0.5 seconds when hovered over.
Example 3: Delayed Transition
This example introduces the transition-delay property, which delays the start of the transition by 0.5 seconds.