Heya all,
ive been redesigning litewarez over the lsat few weeks and ive started to implement a new feature with css called sprites.
What it does:
Basically what you do is create on image containing more than one image then using css you will select the location of a particular image within your main image
this way you can have all your images with just one request this saves alot of bandwidth and speed for your users.
Heres an example of of what the image looks like HERE
here is an example of me using sprite for my download icons
Here is the image that's used for the sprite
Ok so now the html for the icons
now as you can see were setting multiple classes for the div.
the first to are going to be be loaded for all divs using the sprite and the last one is dynamic because they are select different pixal locations for the icons
if you wish to follow this up any further there;s plenty of information on Google :D
hope you enjoy my tip.
Helpfull Links:
Sprite Generator : Provided By -=MOD=-
ive been redesigning litewarez over the lsat few weeks and ive started to implement a new feature with css called sprites.
What it does:
Basically what you do is create on image containing more than one image then using css you will select the location of a particular image within your main image
this way you can have all your images with just one request this saves alot of bandwidth and speed for your users.
Heres an example of of what the image looks like HERE
here is an example of me using sprite for my download icons
Code:
/*This will load the image into the class name sprite_dlIcons*/
.sprite_dlIcons{background:url('../images/sprite_icons.png');}
/*Icons*/
/*This will set the width of every icon*/
.Icon{width:16px;}
/*This is individual classes for each ic.. and there positions*/
.tv{ height:16px; background-position:-0px -0px;}
.template{ height:16px; background-position:-0px -16px;}
.xxx{ height:16px; background-position:-0px -30px;}
.other{ height:16px; background-position:-0px -46px;}
.music{ height:16px; background-position:-0px -63px;}
.movie{ height:16px; background-position:-0px -80px;}
.game{ height:16px; background-position:-0px -98px;}
.ebook{ height:16px; background-position:-0px -112px;}
.app{ height:16px; background-position:-0px -130px;}
Here is the image that's used for the sprite
Ok so now the html for the icons
Code:
<div class="sprite_dlIcons Icon tv"></div>
<div class="sprite_dlIcons Icon game"></div>
<div class="sprite_dlIcons Icon ebook"></div>
<div class="sprite_dlIcons Icon app"></div>
now as you can see were setting multiple classes for the div.
the first to are going to be be loaded for all divs using the sprite and the last one is dynamic because they are select different pixal locations for the icons
if you wish to follow this up any further there;s plenty of information on Google :D
hope you enjoy my tip.
Helpfull Links:
Sprite Generator : Provided By -=MOD=-