एनीमेशन-दिशा का उपयोग करें पहले पिछड़े और फिर आगे में एनीमेशन चलाने के लिए संपत्ति। संपत्ति का उपयोग वैकल्पिक-रिवर्स . के साथ किया जाता है इसे हासिल करने के लिए एनिमेशन वैल्यू।
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 200px;
position: relative;
background-color: yellow;
animation-name: myanim;
animation-duration: 2s;
animation-direction: alternate-reverse;
animation-iteration-count: 3;
}
@keyframes myanim {
0% {background-color:green; left:0px; top:0px;}
50% {background-color:maroon; left:100px; top:100px;}
100% {background-color:gray; left:0px; top:0px;}
}
</style>
</head>
<body>
<div></div>
</body>
</html>