I have a web application whose work I am improving. In an attempt to do this, I decided to use css sprites. I put all my images in a .png file called images.png.
CSS sprites have worked well for all css classes that just render the image once. However, some of my images need to be repeated. For example, I have a banner.png image used for a banner background. Whenever I set the background-repeat property, it seems like the image is not repeating. To show my CSS definitions, here they are:
Before CSS Sprites
------------------
.ghwc {
background-image: url(/images/layout/banner.png);
background-repeat:repeat-x;
color:White;
width:300px;
}
After CSS Sprites
-----------------
.ghwc {
background-image: url(/images/images.png);
background-repeat:repeat-x;
color:White;
background-position:60px 319px;
width:300px;
}
My question is: how to use CSS sprites for repeated images like background?
Thank,
source
share