美文网首页
animation动画

animation动画

作者: 每天进步一点点5454 | 来源:发表于2020-09-16 14:21 被阅读0次

动画主要的属性:
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>

相关文章

网友评论

      本文标题:animation动画

      本文链接:https://www.haomeiwen.com/subject/pvocyktx.html