Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: #ccc;
position: relative;
animation: myfirst 5s 1;
animation-direction: reverse;
}
@keyframes myfirst {
0% {background: #8DC3CF; left: 0px; top: 0px;}
25% {background: #1c87c9; left: 200px; top: 0px;}
50% {background: #030E10; left: 200px; top: 200px;}
75% {background: #666; left: 0px; top: 200px;}
100% {background: #8ebf42; left: 0px; top: 0px;}
}
</style>
</head>
<body>
<h2>Exemple de animation-direction</h2>
<p>Dans cet exemple, l'animation joue comme inversée.</p>
<div></div>
</body>
</html>