Jump to content
Sign in to follow this  
moggy

Drop down menu active state

Recommended Posts

moggy

HI Im trying to change my navigation to a tabbed effect, I've added a background image which works fine, the only issue is on the dropdowns. If a page is active i have a red tab, this shows fine, but for some reason it also shows on each row of the dropdown under the active tab (doesnt show on non active tab dropdowns) i've narrowed it down to .main-nav li.current-page-ancestor a, .main-nav li.current_page_item a, .main-nav li.current-page-ancestor ul a, .main-nav li.current_page_item ul a { color: #FFFFFF; background-image:url('images/bn-red.png'); background-repeat:no-repeat; } but can't figure out why it still appears on the drop down any help would be appreciated cheers

Share this post


Link to post
Share on other sites
cmunns

the dropdown is inheriting this style so you have to be explicit. ` .main-nav li.current-page-ancestor ul.children a, .main-nav li.current_page_item ul.children a, .main-nav li.current-page-ancestor ul.children a, .main-nav li.current_page_item ul.children a { background:none; } ` It's untested, but something like that should work.

Share this post


Link to post
Share on other sites
tody

This is for non active tab dropdown

	.main-nav li a:hover,
	.main_nav ul a:hover,
	.main-nav li.current-page-ancestor a:hover,
	.main-nav li.current_page_item a:hover
	{
	background-color:#000;
	
and this is for active
	.main-nav li.current-page-ancestor a,
	.main-nav li.current_page_item a,
	.main-nav li.current-page-ancestor ul a,
	.main-nav li.current_page_item ul a
	{
	background-color:#000;
	}
	

works for me :)

Share this post


Link to post
Share on other sites
catrina

I think it's because you're using the selector for the submenu items for the same CSS as the main menu items. This is your current code for active pages:

.main-nav li.current-page-ancestor a,
	.main-nav li.current_page_item a,
	.main-nav li.current-page-ancestor ul a,
	{background-color:#000;}
Delete the selector
.main-nav li.current_page_item ul a

from that code to see if it makes a difference.


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×