scootdc 0 Report post Posted October 31, 2011 Please check out the site here: http://barrysellscharleston.com/development2/ I have a three state image for Home that I'm trying to position properly. Nav height is set to 40px and the normal state is white, hover is gray and active is black. Below is the custom code I'm using. #primary-nav {height:40px;} #primary-nav li.menu-item-435 a { background-position: 0 0px; background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll 0 0 transparent; height:40px; width:116px; color: transparent; } #primary-nav li.menu-item-435 a:hover { background-position: 0 -40px; background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll 0 0 transparent; height:40px; width:116px; color: transparent; } #primary-nav li.menu-item-435 a:active { background-position: 0 -80px; background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll left center transparent; height:40px; width: 116px; color: transparent; } What am I doing wrong? Thanx in advance for your help. Share this post Link to post Share on other sites
Danny+ 1,327 Report post Posted October 31, 2011 Hi Scootdc, Try this instead: [code] #primary-nav li.menu-item-435 a { background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll 0 0 transparent; color: transparent; height: 20px; width: 85px; } #primary-nav li.menu-item-435 a:hover { background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll 0 -40px transparent; color: transparent; height: 20px; width: 85px; } #primary-nav li.menu-item-435 a:active { background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/10/nav-home.png") no-repeat scroll 0 -80px transparent; color: transparent; height: 20px; width: 85px; } [/code] I've linked you to a guide that shows you how to do this, the issue you had was your width/height was set incorrectly and you needed to change the position in the image when changing state from active to hover. http://www.w3schools.com/css/css_image_sprites.asp Please search our forums, before posting! Share this post Link to post Share on other sites
scootdc 0 Report post Posted October 31, 2011 Super awesome. Looks to be on the right track. Share this post Link to post Share on other sites
catrina 103 Report post Posted November 1, 2011 Do you need further assistance? Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites
scootdc 0 Report post Posted November 2, 2011 Actually, yes. I want the tabs to stay with the black background (as in the active state) when on that particular page. What do I need to add? the site again is as: http://barrysellscharleston.com/development2/ Thanks in advance. Share this post Link to post Share on other sites
Rob 547 Report post Posted November 2, 2011 This might give you some help with styling that function: http://www.w3schools.com/css/css_link.asp Former PageLines Moderator, Food Expert and Raconteur Share this post Link to post Share on other sites
scootdc 0 Report post Posted November 2, 2011 Thanks for the reply Robert but it's still not doing what it should. I'm missing something. Share this post Link to post Share on other sites
kastelic 6 Report post Posted November 2, 2011 Try changing it to this: [code] #primary-nav li.menu-item-421 a:active , #primary-nav li.menu-item-421.current-menu-item a { background: url("http://barrysellscharleston.com/development2/wp-content/uploads/2011/11/nav-videos.png") no-repeat scroll 0 -80px transparent; color: transparent; border-left: thin solid black; height: 20px; width: 100px; } [/code] Share this post Link to post Share on other sites
catrina 103 Report post Posted December 3, 2011 Can you please repost? Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites