css3 盒子线性流动效果

css 复制代码
        .box{
            position: relative;
            width:180px;
            height:250px;
            background: rgba(0,0,0,0.8);
            border-radius: 20px;
            display: flex;
            justify-content:center;
            align-items: center;
            overflow: hidden;

        }
        .box::before{
            content:'';
            position:absolute;
            width: 100px;
            height: 120%; 
            background:linear-gradient(#ffd900,#f9000c);
            animation:lineRoll 3s linear infinite;
        }
        @keyframes lineRoll{
            0%{
                transform: rotate(0deg);
            }
            50%{
                transform: rotate(180deg);

            }
            to{
                transform: rotate(360deg);
            }
        }
        .box::after{
            content: '';
            position: absolute;
            background: #795548;
            right:4px;
            top:4px;
            left:4px;
            bottom:4px;
            border-radius: 20px;  
        }
        .box h2{
            text-align: center;
            color:white;
            font-size:3em;
            text-shadow:2px 2px pink;
            z-index:1;
        }
html 复制代码
    <div class="box">
        <h2>线性流动</h2>
    </div>
相关推荐
共享家95271 小时前
搭建 AI 聊天机器人:”我的人生我做主“
前端·javascript·css·python·pycharm·html·状态模式
Halo_tjn3 小时前
基于封装的专项 知识点
java·前端·python·算法
m0_748229995 小时前
Vue2 vs Vue3:核心差异全解析
前端·javascript·vue.js
C澒5 小时前
前端监控系统的最佳实践
前端·安全·运维开发
xiaoxue..6 小时前
React 手写实现的 KeepAlive 组件
前端·javascript·react.js·面试
hhy_smile6 小时前
Class in Python
java·前端·python
小邓吖6 小时前
自己做了一个工具网站
前端·分布式·后端·中间件·架构·golang
南风知我意9576 小时前
【前端面试2】基础面试(杂项)
前端·面试·职场和发展
LJianK17 小时前
BUG: Uncaught Error: [DecimalError] Invalid argument: .0
前端
No Silver Bullet7 小时前
Nginx 内存不足对Web 应用的影响分析
运维·前端·nginx