HTML + JS Sprite

In this demo, we create a sprite using a simple <div> element with the background-image set to our sprite. We update the animation by using the background-position property to slide our "window" over the spritesheet.


Move in 64px increments
 <div style="
      width: 64px;
      height: 64px;
      background-image: url('/dude.png');
      background-position: 0px
  ">
  </div>

The red box represents the "window" we are showing in our animation.