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>
相关推荐
大气的小蜜蜂37 分钟前
领域层的服务
java·前端·数据库
星栈41 分钟前
LiveView 的 LiveComponent:比 React 组件更轻,但我一开始真的把它用错了
前端·前端框架·elixir
林希_Rachel_傻希希1 小时前
web性能优化之延迟加载图片和<inframe>
前端·javascript·面试
maxmaxma1 小时前
Konva 从入门到实践 - day1
前端
火星校尉1 小时前
一场数据基建与消费场景的跨界实验
java·前端·数据库·python·php
W是笔名1 小时前
python_let`s try it 6___BMI计算器
java·前端·python
risc1234561 小时前
Lucene80DocValuesConsumer 五种类型源码阅读顺序
java·服务器·前端
小米渣的逆袭2 小时前
Chrome Extension Script World(ISOLATED / MAIN)原理与适用场景
前端·javascript·chrome
微信开发api-视频号协议2 小时前
Codex++安全边界探秘:从模型能力到风险防御
前端·安全·微信·企业微信
想你依然心痛2 小时前
AtomCode 在前端开发中的实战体验:React + TypeScript 项目开发实录
前端·react.js·typescript