码迷,mamicode.com
首页 > Web开发 > 详细

CSS3简单的动画

时间:2014-10-05 22:26:29      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   for   sp   div   c   on   

果子狸有毒
<style>
.demo{
        width:80px;
        height:80px;
        text-align:center;
        line-height:80px;
        background:#f80;
        border:3px solid #eee;
        color:#fff;
        -webkit-animation: animate 3s .5s ease infinite alternate;
        -moz-animation: animate 3s .5s ease infinite alternate;
    }
@-webkit-keyframes animate{
        from {
            background:#f00;
            -webkit-transform:translate(0px) rotate(0deg);
            }
        to {
            background:#33C;
            -webkit-transform:translate(200px) rotate(360deg);
            }
    }
@-moz-keyframes animate{
        from {
            background:#f00;
            -moz-transform:translate(0px) rotate(0deg);
            }
        to {
            background:#33C;
            -moz-transform:translate(200px) rotate(360deg);
            }
    }        
</style>

<div class="demo">果子狸有毒</div>

CSS3简单的动画

标签:style   blog   color   io   for   sp   div   c   on   

原文地址:http://www.cnblogs.com/fixbug/p/4007380.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!