css3 动画

 

 

 

 

 

 

 

 

 

 

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 我们想页面一打开, 一个盒子就从左边走到右边 */
        /* 1定义动画 */
        
        @keyframes move {
            /* 开始状态 */
            0% {
                transform: translateY(0px);
            }
            /* 结束状态 */
            100% {
                transform: translateX(1000px);
            }
        }
        
        div {
            height: 200px;
            width: 200px;
            background-color: pink;
            /* 2 调用动画 */
            animation-name: move;
            /* 持续时间 */
            animation-duration: 3s;
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>
 
 
posted @ 2020-05-22 09:17  EricBlog  阅读(83)  评论(0编辑  收藏  举报