盾牌的动画 用鼠标的悬停实现 旋转的用法

 <!DOCTYPE html>
 <html lang="en">
 <head>
 <meta charset="UTF-8">
 <title>Title</title>
 <style>
 html, body{
 margin:0;
 padding:0;
 height:100%;
 width:100%;
 background-color:green;
 }
 .box{
 height:496px;
 width:420px;
 border:1px solid #000;
 font-size:0;
 }
 img{
 transition:all 1s;
 }
 .box img:nth-child(1){
 transform:translate(580px,450px) rotate(438deg);
 }
 .box img:nth-child(2){
 transform:translate(680px,430px) rotate(638deg);
 }
 .box img:nth-child(3){
 transform:translate(680px,480px) rotate(948deg);
 }
 .box img:nth-child(4){
 transform:translate(480px,330px) rotate(588deg);
 }
 .box:hover img{
 transform:translate(0px,0px) rotate(0deg) ;
 }
 </style>
 </head>
 <body>
 <!--
 .box>img[src="images/shield_1_$$.png"]*9
 -->
 <div class="box">
 <img src="images/shield_1_01.png" alt="">
 <img src="images/shield_1_02.png" alt="">
 <img src="images/shield_1_03.png" alt="">
 <img src="images/shield_1_04.png" alt="">
 <img src="images/shield_1_05.png" alt="">
 <img src="images/shield_1_06.png" alt="">
 <img src="images/shield_1_07.png" alt="">
 <img src="images/shield_1_08.png" alt="">
 <img src="images/shield_1_09.png" alt="">
 </div>
 </body>
 

</html>

过渡是CSS3中具有颠覆性的特征之一,可以实现元素不同状态间的平滑过渡(补间动画),经常用来制作动画效果。

帧动画:通过一帧一帧的画面按照固定顺序和速度播放。如电影胶片

补间动画:自动完成从起始状态到终止状态的的过渡。

关于补间动画更多学习可查看http://mux.alimama.com/posts/1009

特点:当前元素只要有“属性”发生变化时,可以平滑的进行过渡。

transition-property设置过渡属性 ALL

transition-duration设置过渡时间 1s

transition-timing-function设置过渡速度  ease-in-out, linear,ease-out

transition-delay设置过渡延时 1s

Transition:all 1s; 复合属性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值