animation动画

2020-09-16  本文已影响0人  每天进步一点点5454

动画主要的属性:
animation :动画名称 动画秒数 动画匀速
@keyframs : from to 从哪到哪的动画
animation-timing-function:linear; 动画从头到尾的速度是相同的。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css animation</title>
    <style>
        .animation {
            width: 100px;
            height: 100px;
            background-color: red;
            position: relative; 
               /* 动画名称 动画秒数  动画匀速*/
            animation:moveone 5s infinite;
            /*  规定动画的速度曲线 */
            animation-timing-function:linear;
        }
        @keyframes moveone {
            from { 
                left:0;
                background:red;
                }
            to {
                left:90%;
                background:yellow;
                }
        
        }
    </style>
</head>
<body>
    <div class="animation"></div>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读