![]() |
VOOZH | about |
The CSS transition property is used to create smooth animations between changes in CSS property values. It controls how long a transition takes, when it starts, and the speed curve used during the transition.
Syntax:
selector {
transition: <transition-property>
<transition-duration>
<transition-timing-function>
<transition-delay>;
}Property Values:
Note:
- The transition effect is typically applied between different states of an element, such as :hover and :active, or states changed dynamically using JavaScript.
- If a transition value is not specified, the browser uses its default value for that property.
Here are some examples discussed:
In this example we creates a blue box that transitions to green when hovered over, utilizing the CSS transition property to animate the color change over 0.5 seconds with an ease timing function.
Output:
This example demonstrates the use of the transition property to change the width and height
Output: