Gihan Lasita
Gihan Lasita

Reputation: 3055

How to use css image sprites in this code?

i was editing a template and there were around 50 images, so i put all the images into a Image Sprite

so the css is looks like this

.img_set_1 {
   background: url(../images/csg-4e1827fd5b201.png) no-repeat top left;
}
.img_set_1-button_menu_left{ background-position: 0 -256px; width: 19px; height: 29px; } 

the old css file contains this kind of lines and How to modify below line to get image from sprite?

a.blackbutton span { margin:0; padding:7px 0 7px 19px; background:url(images/button_menu_left.gif) no-repeat top left;}

Regards

Upvotes: 0

Views: 185

Answers (1)

Tarek
Tarek

Reputation: 3798

i recommend using a tool that GOOGLE suggest to use

http://spriteme.org/

run the script on ur page and it will generate everything for you, great script!

Upvotes: 1

Related Questions