CSS sprite navigation not working properly.
-
I just designed a new theme for my site, and am using CSS sprites for the first time. The active state is supposed to be a light grey background, hover state – pink and current state dark grey. The dark grey seems to just be sticking to the Blog link.
It’s probably a very small error in code somewhere, but I am really not a coder so it’s driving me crazy.
This is my navigation code (placed in header):
<ul id="navigation"> <li id="navigation-1"><a href="https://miss-hannah.com/" title="Blog" class="current"><span>Blog</span></a></li> <li id="navigation-2"><a href="https://miss-hannah.com/about" title="Girl"><span>Girl</span></a></li> <li id="navigation-3"><a href="https://miss-hannah.com/gallery" title="Gallery"><span>Gallery</span></a></li> <li id="navigation-4"><a href="https://miss-hannah.com/site" title="Site"><span>Site</span></a></li> <li id="navigation-5"><a href="https://miss-hannah.com/links" title="Reads"><span>Reads</span></a></li> </ul>
And this is the navigation CSS (placed in theme stylesheet):
ul#navigation { width:792px; list-style:none; height:69px; margin-right: auto; margin-left: auto; } ul#navigation li { display:inline } ul#navigation li a { height:69px; float:left; } ul#navigation span { display:none } ul#navigation li#navigation-1 a {width:152px; background:url(images/nav_2011.png) no-repeat 0px 0} ul#navigation li#navigation-1 a:active, ul#navigation li#navigation-1 a:hover {background-position:0px -69px} ul#navigation li#navigation-1 a.current {background-position:0px -138px} ul#navigation li#navigation-2 a {width:139px; background:url(images/nav_2011.png) no-repeat -152px 0} ul#navigation li#navigation-2 a:active, ul#navigation li#navigation-2 a:hover {background-position:-152px -69px} ul#navigation li#navigation-2 a.current {background-position:-152px -138px} ul#navigation li#navigation-3 a {width:201px; background:url(images/nav_2011.png) no-repeat -291px 0} ul#navigation li#navigation-3 a:active, ul#navigation li#navigation-3 a:hover {background-position:-291px -69px} ul#navigation li#navigation-3 a.current {background-position:-291px -138px} ul#navigation li#navigation-4 a {width:129px; background:url(images/nav_2011.png) no-repeat -492px 0} ul#navigation li#navigation-4 a:active, ul#navigation li#navigation-4 a:hover {background-position:-492px -69px} ul#navigation li#navigation-4 a.current {background-position:-492px -138px} ul#navigation li#navigation-5 a {width:171px; background:url(images/nav_2011.png) no-repeat -621px 0} ul#navigation li#navigation-5 a:active, ul#navigation li#navigation-5 a:hover {background-position:-621px -69px} ul#navigation li#navigation-5 a.current {background-position:-621px -138px}
Any help would be greatly appreciated!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘CSS sprite navigation not working properly.’ is closed to new replies.