【css3】png图片实现动态动画

css 复制代码
.border_style {
            width: 400px;
            height: 400px;
            background-color: black;
            margin: auto;
        }

        @keyframes sprite-animation {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: 0 -2064px;
                /* 假设每个图像的宽度为100px */
            }
        }
        .wrj_box {
            width: 86px;
            height: 86px;
            background-image: url("./wurenji.png");
            animation: sprite-animation 1s steps(24) infinite;
            z-index: 2000;

        }
html 复制代码
<div class="border_style">
        <div class="wrj_box"></div>
    </div>
相关推荐
tuokuac22 分钟前
nginx配置前端请求转发到指定的后端ip
前端·tcp/ip·nginx
程序员爱钓鱼26 分钟前
Go语言实战案例-开发一个Markdown转HTML工具
前端·后端·go
万少1 小时前
鸿蒙创新赛 HarmonyOS 6.0.0(20) 关键特性汇总
前端
还有多远.1 小时前
jsBridge接入流程
前端·javascript·vue.js·react.js
蝶恋舞者1 小时前
web 网页数据传输处理过程
前端
非凡ghost1 小时前
FxSound:提升音频体验,让音乐更动听
前端·学习·音视频·生活·软件需求
吃饭最爱2 小时前
html的基础知识
前端·html
我没想到原来他们都是一堆坏人2 小时前
(未完待续...)如何编写一个用于构建python web项目镜像的dockerfile文件
java·前端·python
前端Hardy2 小时前
HTML&CSS:有趣的漂流瓶
前端·javascript·css
前端Hardy2 小时前
HTML&CSS :惊艳 UI 必备!卡片堆叠动画
前端·javascript·css