CSS Sprite Sheet Generator
Combine up to 100 images into one sprite sheet and get the CSS classes with each image's size and background position, plus a preview page, in a ZIP. Useful for icon sets, game sprites and reducing image requests.
Frequently asked questions
How are the images arranged?
In a grid. Each cell has the size of the largest image, and you can set the number of columns and the padding between cells. Without a column count, the grid is roughly square.
What does the CSS look like?
A base class with the sprite image, and one class per image named after its file name, such as .sprite-home, with width, height and background-position.
How do I use the sprites?
Add both classes to an element, for example <span class="sprite sprite-home"></span>. The included index.html shows every sprite.
Are images resized?
Images larger than 1024 pixels on a side are scaled down to fit; smaller ones keep their size.
Why use sprites today?
HTTP/2 makes many small requests cheaper, but sprites still help for game animations, email templates and pages with many tiny icons.
What does the prefix do?
It sets the class name prefix, sprite by default, so the classes do not clash with your other CSS.