css3 实现简单动画效果

 1.简单loading效果

<div class="mint-spinner-snake" style="border-top-color: rgb(38, 162, 255); border-left-color: rgb(38, 162, 255); border-bottom-color: rgb(38, 162, 255); height: 88px; width: 88px;"></div>

CSS样式部分:

.mint-spinner-snake{
    animation: circle 1s infinite linear;
    -webkit-animation:circle 1s infinite linear; /* Safari 和 Chrome */
    border:4px solid transparent;
    border-radius: 50%
}
@-webkit-keyframes circle{
    0%{transform:rotate(0deg);}
    100%{transform: rotate(-360deg)}
}

2. :hover放大图片

<!DOCTYPE html>
<html>
<head>
    <title>hover图片变大</title>
    <style type="text/css">
        .lis{
            width:200px;
            height:200px;
            background-color:pink;
            overflow: hidden;
        }
        .img{
            width:200px;
            height:200px;
            transition: all 0.6s;
            cursor:pointer;
        }
         .img:hover{
            transform:scale(1.4);
        }
    </style>
</head>
<body>
    <ul>
        <li class="lis">
            <image class="img" src="./images/lis.jpg"></image>
        </li>
    </ul>
 
</body>
</html>

3. css3 rotate 3D无限旋转 鼠标放上停止旋转

<!DOCTYPE html>
<html>
<head>
    <title>动画无限旋转2D和无限旋转3D</title>
    <style type="text/css">
        .divs{
            width:200px;
            height:200px;
            border-radius: 50%;
            overflow: hidden;
            transform:rotateY(120deg);
            animation:rotate 4s ease infinite;
        }
        /*3d旋转效果*/
        @keyframes rotate{
            0%{
                transform:rotateY(0deg);
            }
            50%{
                transform:rotateY(180deg);
            }
            100%{
                transform:rotateY(360deg);
            }
        }
        .divs:hover{
            cursor:pointer;
            animation-play-state:paused; /*停止动画*/
        }
        /*css3 animation 暂停动画播放 ,动画处于播放完成状态
        aniamtion-play-state: running , paused*/

        .img{
            width:200px;
            height:200px;
        }
    </style>
</head>
<body>
    <div class="divs">
        <image class="img" src="./images/lis.jpg"></image>
    </div>
</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值