css3动画animation

css3动画animaton css样式如下:

.div01 {
    width: 200px;
    height: 200px;
    background: rebeccapurple;
    color: #fff;
    position: relative;
    /*animation:
     *animation-name: 规定需要绑定到选择器的 keyframe 名称
     *animation-duration:规定完成动画花费 时间s 
     *animation-timing-function:规定动画的速度曲线
     *animation-delay:规定在动画开始之前的延迟,允许负值,-2s 使动画马上开始,但跳过 2 秒进入动画
     *infinite规定动画应该无限次播放,也可直接输数值   
     *animation-direction 属性: alternate动画轮流反向播放,normal正常顺序播放(默认)*/
    animation: ani 5s infinite alternate;
    -webkit-animation: ani 5s infinite alternate;
}

@keyframes ani {
    0% {
        background: red;
        top: 0;
        left: 0;
    }
    25% {
        background: mistyrose;
        top: 0;
        left: 200px;
    }
    50% {
        background: yellow;
        top: 200px;
        left: 200px;
    }
    75% {
        background: brown;
        top: 200px;
        left: 0;
    }
    100% {
        background: mistyrose;
        top: 0;
        left: 0;
    }

}

 

转载于:https://my.oschina.net/u/3628277/blog/1490195

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值