码迷,mamicode.com
首页 > 其他好文 > 详细

动画多状态写法2

时间:2019-09-26 10:10:56      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:无限循环   box   pre   ack   状态   doctype   text   document   utf-8   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        .box {
            /* infinite 无限循环
            alternate 逆播  */
            animation: changes 3s infinite alternate;
        }
        /* 百分比是相对动画时长 */
        @keyframes changes {
            0% {
                width: 100px;
                height: 100px;
                background-color: red;
            }
            30% {
                width: 200px;
                height: 400px;
                background-color: blue;
            }
            60% {
                width: 300px;
                height: 600px;
                background-color: skyblue;
            }
            100% {
                width: 600px;
                height: 800px;
                background-color: #ccc;
            }
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>

动画多状态写法2

标签:无限循环   box   pre   ack   状态   doctype   text   document   utf-8   

原文地址:https://www.cnblogs.com/divtab/p/11588660.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!