I have tried to setup a navigation bar for a website but the problem is, the navigation bar won't hover to a different colour when i take my mouse cursor on top of the links (home, about us...etc.)
I have tried making the navigation using sprites technique and the image below (nav.png) is what i used for the same:
[IMG]http://i33.tinypic.com/2jxr4j.png[/IMG]
Also, if you want to know the tutorial which i followed for this navigation bar then the link is below:
http://stylemeltdown.com/2007/10/22/image-sprite-navigation-with-css/
HTML:
Here's my HTML code for the navigation bar inside a div header.
<div id="header">
<ul id="nav">
<li id="but-1"><a href="#">home</a></li>
<li id="but-2"><a href="#">latest news</a></li>
<li id="but-3"><a href="#">about us</a></li>
<li id="but-4"><a href="#">gallery</a></li>
<li id="but-5"><a href="#">contact us</a></li>
</ul>
</div>
CSS:
And here's the CSS code for the same:
#header ul#nav{
background:url(images/nav.png) no-repeat; width:512px; height:18px; text-indent:-9999px;
}
#header ul#nav li, #header ul#nav a{
display:block; height:18px;
}
#header ul#nav li{
display:inline; float:left; list-style:none;
}
#header ul#nav li#but-1{width:64;}
#header ul#nav li#but-2{width:138;}
#header ul#nav li#but-3{width:108;}
#header ul#nav li#but-4{width:97;}
#header ul#nav li#but-5{width:105;}
#header ul#nav li#but-1 a:hover{background:url(images/nav.png) 0px -18px no-repeat;}
#header ul#nav li#but-2 a:hover{background:url(images/nav.png) -64px -18px no-repeat;}
#header ul#nav li#but-3 a:hover{background:url(images/nav.png) -202px -18px no-repeat;}
#header ul#nav li#but-4 a:hover{background:url(images/nav.png) -310px -18px no-repeat;}
#header ul#nav li#but-5 a:hover{background:url(images/nav.png) -407px -18px no-repeat;}
Please help me, and explain me where i am wrong and why won''t it show the hover state.