html5+css3动画

此动画仅限谷歌浏览器····


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
                  //格式的大小与循环移动改变颜色
.myfirst{
height: 200px;
background:red;
width: 200px;
position:relative;
-webkit-animation: myfirst 5s linear 0s infinite alternate;

}
//颜色与位置的变化
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:500px; top:500px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

</style>


<body>

<div class="myfirst"></div>
</body>
</html>

你可能感兴趣的:(动画,html5,css3)