Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <style> div { width: 100px; height: 100px; background: #1c87c9; position: relative; -webkit-animation: element 5s; /* Safari 4.0 - 8.0 */ -webkit-animation-fill-mode: backwords; /* Safari 4.0 - 8.0 */ animation: element 5s; animation-fill-mode: backwords; } /* Safari 4.0 - 8.0 */ @-webkit-keyframes element { from { top: 0px; } to { top: 200px; background-color: blue; } } @keyframes element { from { top: 0px; } to { top: 200px; background-color: #8ebf42; } } </style> </head> <body> <h2>Animation-fill-mode example</h2> <div></div> </body> </html>