How to create a transition effect with CSS?

To create a transition effect, set the property for the transition effect. With that also set the duration of effect.

transition: height 5s;

You can try to run the following code to create a transition effect

Example


   
      
   
   
      

Heading One

     

Hover over the below box to change its width.

     
   
Updated on: 2026-03-11T22:50:41+05:30

162 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements