views:

41

answers:

4

Is it possible to use three images in CSS sprite navigation?

This may be like this

My image

If its possible what will be the result?

A: 

You can use any number of images in a sprite. Depends on your requirement.

rahul
+1  A: 

Yes it is possible. See exaple here http://www.ehousestudio.com/blog/view/css_sprite_navigation_tutorial

vooD
Great resource. +1
Kyle Sevenoaks
A: 

If done right this will be the result:

alt text

jensgram
I know it's lame. But I have no idea what OP wants :)
jensgram
A: 

You can use any amount of images in a sprite, just move the positioning around in your CSS:

.sprite1
{
background-image:url(../../upload/btn_continue_sprite.png);
    background-repeat:no-repeat;
    background-position: -10px 5px;
}

.sprite1:hover
{
background-image:url(../../upload/btn_continue_sprite.png);
    background-repeat:no-repeat;
    background-position: -20px 10px;
}

.sprite2
{
background-image:url(../../upload/btn_continue_sprite.png);
    background-repeat:no-repeat;
    background-position: -30px 15px;
}

.sprite2:hover
{
background-image:url(../../upload/btn_continue_sprite.png);
    background-repeat:no-repeat;
    background-position: -40px 20px;
}

Just have to figure out the px distances to align the sprite to the element properly and you're away!

Hope that helps.

Kyle Sevenoaks