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>
相关推荐
氢灵子4 分钟前
Fixed 定位的失效问题
前端·javascript·css
haibindev24 分钟前
把近5万个源文件喂给AI之前,我先做了一件事
java·前端·c++·ai编程·代码审计·架构分析
labixiong35 分钟前
React Hooks 闭包陷阱:高级场景与深度思考
前端·javascript·react.js
☞无能盖世♛逞何英雄☜1 小时前
Echarts数据可视化应用
前端·信息可视化·echarts
2501_943610361 小时前
我爱导航系统美化版源码网址导航系统带后台-【全开源】
前端·后端·html·php
__Yvan1 小时前
Kotlin 的 ?.let{} ?: run{} 真的等价于 if-else 吗?
android·开发语言·前端·kotlin
陈随易2 小时前
我也曾离猝死很近
前端·后端·程序员
喵个咪2 小时前
GoWind Content Hub|风行,开箱即用的企业级前后端一体内容中台
前端·后端·cms
我命由我123452 小时前
React - 路由样式丢失问题、路由观察记录、路由传递参数
开发语言·前端·javascript·react.js·前端框架·html·ecmascript
英俊潇洒美少年2 小时前
React类组件和函数组件的所有核心区别
前端·javascript·react.js