您的位置:首页 > Web前端 > HTML5

html5+css3动画

2015-06-11 17:51 621 查看
此动画仅限谷歌浏览器····


<!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> 阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: