Which CSS property is used to run Animation in Reverse Direction?

CSSWeb DevelopmentFront End Technology

Use the animation-direction property to run animation in reverse direction. The property is used with the reverse animation value to achieve this.

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 200px;
            background-color: yellow;
            animation-name: myanim;
            animation-duration: 2s;
            animation-direction: reverse;
         }
         @keyframes myanim {
            from {
               background-color: green;
            }
            to {
               background-color: blue;
            }
         }
      </style>
   </head>
   <body>
      <div></div>
   </body>
</html>
raja
Published on 16-May-2018 13:06:43
Advertisements