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>
相关推荐
荔枝一杯酸牛奶39 分钟前
HTML 表单与表格布局实战:两个经典作业案例详解
前端·html
Charlie_lll1 小时前
学习Three.js–纹理贴图(Texture)
前端·three.js
yuguo.im1 小时前
我开源了一个 GrapesJS 插件
前端·javascript·开源·grapesjs
安且惜1 小时前
带弹窗的页面--以表格形式展示
前端·javascript·vue.js
米奇妙妙wuu1 小时前
css实现文字和边框同样的渐变色效果
css·html·css3
GISer_Jing2 小时前
AI驱动营销:业务技术栈实战(From AIGC,待总结)
前端·人工智能·aigc·reactjs
GIS之路4 小时前
GDAL 实现影像裁剪
前端·python·arcgis·信息可视化
AGMTI4 小时前
webSock动态注册消息回调函数功能实现
开发语言·前端·javascript
不会Android的潘潘4 小时前
受限系统环境下的 WebView 能力演进:车载平台 Web 渲染异常的根因分析与优化实践
android·java·前端·aosp
建军啊4 小时前
java web常见lou洞
android·java·前端