Which CSS property is used to run Animation in Alternate Cycles?

CSSWeb DevelopmentFront End Technology

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


Live Demo

<!DOCTYPE html>
         div {
            width: 150px;
            height: 200px;
            background-color: yellow;
            animation-name: myanim;
            animation-duration: 2s;
            animation-direction: alternate;
            animation-iteration-count: 3;
         @keyframes myanim {
            from {
               background-color: green;
            to {
               background-color: blue;
Published on 16-May-2018 14:24:14