We would like to know how to chain animation together.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!--from ww w. ja v a 2 s .c o m-->
background: red;
height: 200px;
margin: 200px auto;
width: 200px;
-webkit-animation: fadeIn 1s ease-in, rotate 2s linear 1s 2 alternate;
-moz-animation: fadeIn 1s ease-in, rotate 2s linear 1s 2 alternate;
-ms-animation: fadeIn 1s ease-in, rotate 2s linear 1s 2 alternate;
-o-animation: fadeIn 1s ease-in, rotate 2s linear 1s 2 alternate;
animation: fadeIn 1s ease-in, rotate 2s linear 1s 2 alternate;
}
@-webkit-keyframes fadeIn {
0% {opacity: 0;}
100%{opacity:1;}
}
@-webkit-keyframes rotate {
0% {-webkit-transform: rotate(45deg);}
100%{-webkit-transform:rotate(0deg);}
}
@-moz-keyframes fadeIn {
0% {opacity: 0;}
100%{opacity:1;}
}
@-moz-keyframes rotate {
0% {-webkit-transform: rotate(45deg);}
100%{-webkit-transform:rotate(0deg);}
}
@-ms-keyframes fadeIn {
0% {opacity: 0;}
100%{opacity:1;}
}
@-ms-keyframes rotate {
0% {-webkit-transform: rotate(45deg);}
100%{-webkit-transform:rotate(0deg);}
}
@-o-keyframes fadeIn {
0% {opacity: 0;}
100%{opacity:1;}
}
@-o-keyframes rotate {
0% {-webkit-transform: rotate(45deg);}
100%{-webkit-transform: rotate(0deg);}
}
@keyframes fadeIn {
0% {opacity: 0;}
100%{opacity:1;}
}
@keyframes rotate {
0% {-webkit-transform: rotate(45deg);}
100%{-webkit-transform:rotate(0deg);}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
The code above is rendered as follows: