Jump to content
Sign in to follow this  
christian_w

Grandchildmenu - how to address current-page-item?

Recommended Posts

christian_w

I have difficulties to attribute a certain style for the "current-state" of the grandchild-menus. E.g. a red border-left is assigned to the page "Rational Choice Theory" on mouseover http://krimtheo.criminologia.de/theorien/neo-klassische-theorien/rational-choice-theory. The CSS-code for this effect reads like this:

#grandchildnav li.page-item-142:hover{border-left:8px solid #FF0000;}
Now I would like to assign that same effect to the current_page_item-class. I already tried
#grandchildnav current_page_item li.page-item-140{border-left:8px solid #FF0000;}

and dozens of alternative modifications. But nothing I tried seems to work. Has anyone an idea how to handle that problem. Thanks in advance.

Share this post


Link to post
Share on other sites
catrina

Try this code:

#grandchildnav li.current_page_item{border-left:8px solid #FF0000;}


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
christian_w

Hey Catrina, thanks for tip. The code you suggested works in principle. The only problem I am facing is that this addition has an effect on every grandchild-menu-item on my site. But I don't want it to apply to the whole site, I would like different colored borders for different grandchild-menu-items (like in the example I gave above).

Share this post


Link to post
Share on other sites
kastelic
 #grandchildnav .page-item-142.current_page_item
	
	See how theres no space between the two classes? This will only affect an element with class of current_page_item [i]and[/i] [code]page-item-142

. This will allow you to change the color of the border pased on the item id.

Share this post


Link to post
Share on other sites
kastelic
#grandchildnav .page-item-142.current_page_item
See how theres no space between the two classes? This will only affect an element with class of
current_page_item
and
page-item-142

. This will allow you to change the color of the border based on the item id.

Share this post


Link to post
Share on other sites
christian_w

That's it Jimmy. Thanks so much.

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  

×