Open In App

How to reverse an animation on mouse out after hover?

CSS Animations lets various elements on a web page to gradually change from one style to another. These make the website look more attractive and interesting reversing an animation means playing it backward.

Approach 1: This example illustrates reversing an animation using @keyframes from to @keyframes to and vice versa for reverse animation.

Approach 2: This example illustrates the use of transition property to create an animation effect on mouse hover and reversed animation on mouse out events.


Article Tags :