Sprites on the web

Josh Comeau logo and Sprites on the Web title, with a cartoon person and a row of trophy sprites. CSS and an img tag code snippet on the right.

Josh Comeau shows how to animate spritesheets in CSS within the <img> viewport: object-fit, object-position, and steps(jump-none) for clean frame-by-frame motion, plus when sprites beat GIFs, and when procedural animation is better.

joshwcomeau.com/animation/sprites