css animation all properties code example
Example 1: animation properties css
function party(){
document.body.style.animation = 'party 2.5s infinite linear';
}
Example 2: animation properties css
body{
background-color: purple;
}
@keyframes party{
0% {background-color: red;}
10% {background-color: orange;}
20% {background-color: yellow;}
30% {background-color: green;}
40% {background-color: blue;}
50% {background-color: purple;}
}
@-webkit-keyframes party{
0% {background-color: red;}
10% {background-color: orange;}
20% {background-color: yellow;}
30% {background-color: green;}
40% {background-color: blue;}
50% {background-color: purple;}
}
Example 3: animation properties css
<html>
<body id="bd">
<button onclick="party()">Press Me!</button>
</body>
</html>