Jump to content

CSS Sprites


Xtremer360

Recommended Posts

Trying to figure how how to turn my nav bar into where if you hover over one of the parts of the nav bar it turns into the highlighted version of that part.

 

Web Site: http://kansasoutlawwrestling.com/v3/index.php

 

Nav Bar: http://kansasoutlawwrestling.com/v3/images/nav.png

 

Highlighted Nav Bar: http://kansasoutlawwrestling.com/v3/images/nav2.png

Link to comment
https://forums.phpfreaks.com/topic/193949-css-sprites/
Share on other sites

You need to split the entire picture into seperate HTML elements.

Then use the style 'background-image: ...' on each element.

 

For the effect you can use :hover in your css.

 

This should explain everything:

http://themes.cmsmadesimple.org/Howto/Image_menu.html

Link to comment
https://forums.phpfreaks.com/topic/193949-css-sprites/#findComment-1020692
Share on other sites

You just need to combine your nav and hover nav picture, put the nav hover underneath so it is a total of 428px in height.

 

You can then set each of the buttons to the background-position, then when you need to hover you just need to change it so it shows the hover one.

 

This this article on css tricks should give you a helping hand on any info you need about css sprites.

Link to comment
https://forums.phpfreaks.com/topic/193949-css-sprites/#findComment-1020767
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.