h5放大缩小循环动画记录

2019-05-23  本文已影响0人  小黑猿
animation.gif
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        @keyframes opacity-alt2{
            0% {
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
                -ms-transform: scale(1);
                -o-transform: scale(1);
                transform: scale(1);
            }
            50%{
                -webkit-transform: scale(1.2);
                -moz-transform: scale(1.2);
                -ms-transform: scale(1.2);
                -o-transform: scale(1.2);
                transform: scale(1.2);
            }
            100%{
                -webkit-transform: scale(1);
                -moz-transform: scale(1);
                -ms-transform: scale(1);
                -o-transform: scale(1);
                transform: scale(1);
            }
        }
        .demo{
            width: 100px;
            height: 100px;
            margin:0 auto;
            margin-top: 200px;
            background: red;
            animation:opacity-alt2 2s infinite;
            -moz-animation:opacity-alt2 2s infinite; /* Firefox */
            -webkit-animation:opacity-alt2 2s infinite; /* Safari and Chrome */
            -o-animation:opacity-alt2 2s infinite; /* Opera */
        }
    </style>
</head>
<body>
    <div class="demo">

    </div>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读