CSS sprite image + background-repeat a part of it

Waseem picture Waseem · Apr 6, 2011 · Viewed 8.6k times · Source

Can I repeat a part of an image [which it's in a CSS sprite image] in the background ?!

like for example :

background-position : -13px top ; background-repeat : repeat-y ;

because I got the whole sprite image repeated ...

Answer

Gareth picture Gareth · Apr 6, 2011

If you place your images side by side in a really wide sprite you'll be able to use repeat-y. If you need to use repeat-x you can place the images in the sprite above each other.