动画练习-360度旋转-animation

animation
也是css3属性的一员

animation: name duration timing-function delay iteration-count direction;
包括:
动画名,
完成一次动画所需要的时间,
动画速度函数(linear,ease等),
动画开始之前的延时,
动画执行的次数(默认是1,常用inifite)
规定是否应该轮流反向播放动画。(默认是normal,alternate代表完成动画一次需要返回去一次)

//必须要的两个属性,即动画名和完成动画所需要的时间
animation: name duration;

360度旋转小案例

html
<img src="T001.jpg" />

css
img {
border-radius: 50%;
animation: rotateArround 3.5s linear 3s infinite alternate;
-webkit-animation: rotateArround 3.5s linear 3s infinite alternate;
-moz-animation: rotateArround 3.5s linear 3s infinite;
-ms-animation: rotateArround 3.5s linear 3s infinite;
-o-animation: rotateArround 3.5s linear 3s infinite;
}

@keyframes rotateArround {
from {transform: rotateZ(0deg);}
to {transform: rotateZ(360deg);}
}

@-webkit-keyframes rotateArround {
from {-webkit-transform: rotate(0deg);
}
to {-webkit-transform: rotate(360deg);}
}

@-moz-keyframes rotateArround {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(360deg);}
}

@-ms-keyframes rotateArround {
from {-ms-transform: rotate(0deg);}
to {-ms-transform: rotate(360deg);}
}

@-o-keyframes rotateArround {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}

  

————————————————
版权声明:本文为CSDN博主「Baby_加油_」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_34664239/article/details/83000748

转载于:https://www.cnblogs.com/beimingbingpo/p/11457842.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值