首页 > Web开发 > 详细

css 动画效果

时间:2015-05-14 23:21:26      阅读:212      评论:0      收藏:0      [点我收藏+]

css3的动画需要遵循@keyframes规制
<div>动画效果</div>

 

div{


width: 100px;
height: 100px;
background: red;
/* 相对布局*/
position: relative;
animation: anim 5s infinite alternate;
-webkit-animation: anim 5s infinite alternate;

}
@keyframes anim{

0%{background: red;left: 0px;top: 0px}
25%{background: blue;left: 200px;top: 0px}
50%{background: orange;left: 200px;top: 200px}
75%{background: yellow; left: 0px;top: 200px}
100%{background: red;left: 0;top: 0px}
}
@-webkit-keyframes anim{

0%{background: red;left: 0px;top: 0px}
25%{background: blue;left: 200px;top: 0px}
50%{background: orange;left: 200px;top: 200px}
75%{background: yellow; left: 0px;top: 200px}
100%{background: red;left: 0;top: 0px};
}

css 动画效果

原文:http://www.cnblogs.com/xiezefeng/p/4504715.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!