Image sprites bundle multiple icons in one image and reveal them via background position. Mostly legacy, but still useful to understand.
When sprites were used
- Reduce HTTP requests in older performance models.
- Serve many small icons from one asset.
Modern reality
Today, SVG icon systems usually provide better maintainability, scaling, and accessibility.
Important interview questions and answers
- Q: Why did sprites become less common?
A: HTTP/2+, SVG workflows, and modern bundling reduced their advantage. - Q: Sprite downside?
A: Harder maintenance and resolution/scaling constraints. - Q: Where might you still see sprites?
A: Legacy systems and game-style sprite sheets.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.