效果如下:
css代码如下:
<style>
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove .2s infinite;
-webkit-animation:mymove .2s infinite; /*Safari and Chrome*/
}
@keyframes mymove
{
from {top:0px;}
to {top:10px;}
}
@-webkit-keyframes mymove /*Safari and Chrome*/
{
from {top:0px;}
to {top:10px;}
}
</style>
html代码如下:
<div></div>