css渐变实现进度条动画

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 600px;
            height: 60px;
            border-radius: 60px;
            overflow: hidden;
            box-sizing: border-box;
            background-color: #a9a9a9;
        }
        .box::after {
            content: "";
            position: absolute;
            width: 100%;
            height: 200%;
            top: 0;
            left: 0;
            background: repeating-linear-gradient(-45deg, yellow 0 20px, transparent 20px 40px);
            animation: move 0.5s linear infinite;
        }
        @keyframes move {
            from {
                transform: translateY(0);
            }
            to {
                transform: translateY(-58px);
            }
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>
复制代码

 

posted @   猫月贰  阅读(205)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
点击右上角即可分享
微信分享提示