Book a call Free rebuild
Home/Glossary/Design/Image Sprite

Image Sprite

February 28, 2023 Updated November 16, 2026 2 min read

Design glossaryAn image sprite combines several small images, such as icons, into one file, with CSS showing the right part of it. HTTP/2 and SVG icons have made sprites far less necessary.

An image sprite, often called a CSS sprite, is one image file that holds many small graphics laid out side by side, such as a set of icons or the normal and hover states of a button. Instead of loading each graphic separately, the page loads the single sheet and uses CSS to show only the part it needs in each place. The name comes from early video games, where small moving graphics were called sprites.

How it works

Each element that should show an icon gets the sprite as its background-image, a fixed width and height the size of one icon, and a background-position that shifts the sheet so the right icon shows through. A hover state can change only the position, so the hover graphic is already loaded and appears instantly, with no flicker.

Under HTTP/1.1, every image was a separate request, and browsers only opened a handful of connections to each server at once. A page with 30 small icons had to queue them, which slowed it down. Combining them into one file meant one request, and the sheet was cached for every later page.

Are sprites still worth it?

Much less often. HTTP/2 and HTTP/3 send many files over one connection at the same time, so the cost of extra requests is far lower. Sprites also have real drawbacks:

  • Accessibility: a CSS background image has no alt text, so any icon that carries meaning needs a text label for screen readers.
  • Caching: changing one icon changes the whole file, so every visitor downloads the full sheet again.
  • Wasted bytes: a page that shows two icons still downloads all of them.
  • Maintenance: positions are hard-coded in CSS, and high-density screens need a second sheet at twice the size.

For icons, most sites now use SVG, either inline in the HTML or as an SVG sprite: one file of <symbol> elements, each referenced with <use>. SVG icons stay sharp at any size and can be recolored with CSS. Raster sprites still make sense for games, animations drawn frame by frame, and some very icon-heavy interfaces.

In WordPress

Most WordPress themes no longer use raster sprites. The block editor and core use SVG icons, and the older admin icons, Dashicons, are an icon font. When we take over an older theme that still loads a large sprite sheet, we check how many of the icons are actually used. Often a few inline SVGs replace the whole file and cut the page weight.

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.