.animation {
width: 80px;
height: 80px;
position: relative;
overflow: hidden;
}
.sprite {
width: 640px;
height: 80px;
background-image: url('sprite.png');
position: absolute;
top: 0;
left: 0;
animation: play 1s steps(8) infinite;
}
@keyframes play {
0% {
background-position-x: 0;
}
100% {
background-position-x: -640px;
}
}