帧动画

// 56为动画帧数 280rem为动画总长度,可以用px

.ani-no{
    width: 5rem;
    height: 2rem;
    margin: 0 auto;
    background: url('./../assets/images/ani/ani-no.png') 0 0 no-repeat; 
    background-size: 280rem 2rem; 
    animation: anino 3.5s steps(56) infinite;
}
@keyframes anino {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: -280rem 0;
    }
}

  

你可能感兴趣的