Useful Stuff About:

Using image "sprites" for rollover buttons

This image below is called a "sprite" which is defined as basically several images in a grid.
(Each individual part of this larger example image is 100x40px)

This sprite image is useful because:

You just have to create a SINGLE image not cluttering up your images folder with lots of images (in this case without sprites, you'd have to create 40 individual images for each variation)

It gets loaded one time but used several times so the load time is fast

You can use understandable CSS (rather than complicated, difficult to write/understand JavaScript) to make a particular part of the large image be displayed but the rest of the images in the grid to be hidden

You can also use understandable CSS (rather than complicated, difficult to write/understand JavaScript) to make another part of the image appear for its link state (in this case green), hover state (in this case yellow) when the cursor is hovering over the image, or its active state (in this case red) when the mouse is being pressed down over the image

Here is an example of how to use these sprite images. Try hovering over an image and also clicking and holding down the mouse over an image.

CSS (copy and paste into the external style sheet)

/*This block is for the container that holds all the smaller div containers for the each button.*/ #allButtons { position: relative; height: 40px;/*adjust to your specific needs*/ width: 1000px;/adjust to your specific needs*/ }

/*This sets the rollover effect by shifting the hovered/clicked image UP to reveal the desired version */ .btnImg:link {/*normal link without ever clicking on it*/ margin-top: 0px; } .btnImg:hover {/*hover is when the mouse is hovering over the image, adjust as needed*/ margin-top: -40px;/*negative shifts image UP, positive would shift image DOWN*/ } .btnImg:active {/*active is when the mouse is being pressed down, adjust as needed*/ margin-top: -80px; }

/*This allows each div holding a sprite to position itself to the right or bellow of the previous div.*/ .btnDiv { width:100px; height:40px; overflow: hidden;/*hides the part of the image not in the div */ float:left;/*allows the div to reposition to right or below */ }