CSS3动画

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>CSS3动画</title>
    <style type="text/css">
        div{
            height: 50px;
            width: 50px;
            background: pink;
            /*调用动画*/
            animation:animates 5s linear 1s 2;
        }
        /*创建 关键帧*/
        @keyframes animates{
            0%{
                width: 0px;
                transform: translate(50px,0);
            }
            25%{
                width: 25px;
                height: 25px;
                transform: translate(150px,0) rotate(90deg);
            }
            50%{
                width: 50px;
                height: 50px;
                transform: translate(300px,0) rotate(180deg);
            }
            75%{
                width: 25px;
                height: 25px;
                transform: translate(150px,0) rotate(270deg);
            }
            100%{
                width: 50px;
                height: 50px;
                transform: translate(50px,0) rotate(360deg);
            }
          }
    </style>


</head>
<body>
  <div></div>
</body>
</html>

 

posted @ 2017-11-02 22:05  亲亲的我来了  阅读(98)  评论(0编辑  收藏  举报