Prev Demo
CSS3
>
Animation Properties
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title></title> <style> div { width: 100px; height: 100px; background-color: red; position: relative; /* for chrome, safari */ -webkit-animation-name: example; -webkit-animation-duration: 4s; -webkit-animation-delay: 2s; /* for firefox and safari*/ -moz-animation-name: example; -moz-animation-duration: 4s; -moz-animation-delay: 2s; /* Standard syntax*/ animation-name: example; animation-duration: 4s; animation-delay: 2s; /* for opera */ -o-animation-name: example; -o-animation-duration: 4s; -moz-animation-delay: 2s; } @-webkit-keyframes example { 0% { background-color: red; left: 0px; top: 0px; } 50% { background-color: blue; left: 200px; top: 200px; } 100% { background-color: red; left: 0px; top: 0px; } } @-moz-keyframes example { 0% { background-color: red; left: 0px; top: 0px; } 50% { background-color: blue; left: 200px; top: 200px; } 100% { background-color: red; left: 0px; top: 0px; } } @-o-keyframes example { 0% { background-color: red; left: 0px; top: 0px; } 50% { background-color: blue; left: 200px; top: 200px; } 100% { background-color: red; left: 0px; top: 0px; } } @keyframes example { 0% { background-color: red; left: 0px; top: 0px; } 50% { background-color: blue; left: 200px; top: 200px; } 100% { background-color: red; left: 0px; top: 0px; } } </style> </head> <body> <h2>Animation delay for 2s </h2> <div></div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output