The animation-duration
property controls the time span in seconds or milliseconds for one animation cycle.
animation-duration: time;
animation-duration |
4.0 -webkit- | 10.0 | 16.0 (5.0 -moz-) | 4.0 -webkit- | 15.0 -webkit- (12.0 -o-) |
<!DOCTYPE html>
<html>
<head>
<style>
div {<!--from ww w. j a va2 s . c om-->
width: 100px;
height: 100px;
background: black;
position: relative;
-webkit-animation: mymove infinite; /* Chrome, Safari, Opera */
-webkit-animation-duration: 4s; /* Chrome, Safari, Opera */
animation: mymove infinite;
animation-duration: 4s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes mymove {
from {top: 0px;}
to {top: 200px;}
}
@keyframes mymove {
from {top: 0px;}
to {top: 200px;}
}
</style>
</head>
<body>
<div></div>
</body>
</html>