@Ryan Kinal is right when saying in his answer that a sprite image can't be used for repeating background images (in both directions).
There is still a way to do it cross-browser with only one or two files (not images), but it isn't that simple and should prove complicated to modify (though sprites are also complicated to modify, but at least it's visual!).
- data: base64 encoding for modern browsers and IE8+
- MHTML for IE7 and below (see comments for IE7 on Vista), rediscovered or translated by Stoyan Stefanov
As stated in the PHPIED article, the inline images are repeated twice but with the help of 3 conditional comments you can aim IE7 and below with the MHTML file, IE8 and above with the data: base 64 file and !IE with the same data file.
You end up with 5 different files on your server and 4 downloaded by any given browser:
- an image with
no-repeat
-ing sprites
- an image with
repeat-x
-ing sprites
- an image with
repeat-y
-ing sprites
- a file for MHTML (should be served to IE7 and below) background-images
- a file for the same repeating background images but data encoded for IE8+ and !IE browsers
Large repeating images shouldn't be encoded as filesize could increase a lot, your design may vary.