HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ width: 100px; height: 100px; border: 1px solid #000; line-height: 6; text-align: center; animation: myAnimation 5s infinite; -webkit-animation: myAnimation 5s infinite; /* Safari 4.0 - 8.0 */ animation-direction: alternate; -webkit-animation-direction: alternate; /* Safari 4.0 - 8.0 */ } @-webkit-keyframes myAnimation { 0% {background-color: black;} 20% {background-color: blue;} 40% {background-color: brown;} 60% {background-color: green;} 80% {background-color: coral;} 100% {background-color: white;} } @keyframes myAnimation { 0% {background-color: black;} 20% {background-color: blue;} 40% {background-color: brown;} 60% {background-color: green;} 80% {background-color: coral;} 100% {background-color: white;} } </style> </head> <body> <h1>CSS @keyframes Rule</h1> <div> Div </div> </body> </html>
OUTPUT
×

Save as Private