.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;
}
<div class="border_style">
<div class="wrj_box"></div>
</div>