Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 04:15 PM   PM User | #1
krispol
New Coder

 
Join Date: May 2012
Posts: 52
Thanks: 12
Thanked 0 Times in 0 Posts
krispol is an unknown quantity at this point
Removing highlight from subpages when parent page selected. Wordpress

Hei

I have been looking around, but haven't found any solution to my problem that wold actually work.

Maybe some of you may know the answer.

I have a menu with a submenu on my wordpress webpage, my problem is that when I click on the page then all the subpages in the menu are also highlighted. How can I remove that? (So only the parent page would be highlighted until I click on one of the submenus)

Here it is: http://lintech.fi/
krispol is offline   Reply With Quote
Old 10-05-2012, 04:30 PM   PM User | #2
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Quote:
Originally Posted by krispol View Post
Hei

I have been looking around, but haven't found any solution to my problem that wold actually work.

Maybe some of you may know the answer.

I have a menu with a submenu on my wordpress webpage, my problem is that when I click on the page then all the subpages in the menu are also highlighted. How can I remove that? (So only the parent page would be highlighted until I click on one of the submenus)

Here it is: http://lintech.fi/
Go to your stylesheet here:
http://lintech.fi/wordpress/wp-content/themes/amdhas/style.css

...and comment out this line (line 1,995):

Code:
#navmenu li.current_page_item a,  

#navmenu li.current-menu-item a,
#navmenu2 li.current_page_item a,  

#navmenu2 li.current-menu-item a {

	color: #000;

}
That should sort it out...
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Old 10-05-2012, 04:36 PM   PM User | #3
krispol
New Coder

 
Join Date: May 2012
Posts: 52
Thanks: 12
Thanked 0 Times in 0 Posts
krispol is an unknown quantity at this point
Quote:
Originally Posted by Rowsdower! View Post
Go to your stylesheet here:
http://lintech.fi/wordpress/wp-content/themes/amdhas/style.css

...and comment out this line (line 1,995):

Code:
#navmenu li.current_page_item a,  

#navmenu li.current-menu-item a,
#navmenu2 li.current_page_item a,  

#navmenu2 li.current-menu-item a {

	color: #000;

}
That should sort it out...
Thanks for the quick reply!

Did it, it indeed removes the highlight, but now there is no highlight at all. If I select one of the main pages the subpages are not highlighted which is what I wanted but the main page itself now unfortunately is also not highlighted
krispol is offline   Reply With Quote
Old 10-05-2012, 05:07 PM   PM User | #4
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Oops! Sorry about that. Instead of commenting out the line just make these changes:

Code:
#navmenu li.current_page_item>a,  

#navmenu li.current-menu-item>a,
#navmenu2 li.current_page_item>a,  

#navmenu2 li.current-menu-item>a {

	color: #000;

}
That makes it apply only to anchor tags that are the IMMEDIATE child of the "current" <li> element.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Users who have thanked Rowsdower! for this post:
krispol (10-05-2012)
Old 10-05-2012, 05:12 PM   PM User | #5
krispol
New Coder

 
Join Date: May 2012
Posts: 52
Thanks: 12
Thanked 0 Times in 0 Posts
krispol is an unknown quantity at this point
Quote:
Originally Posted by Rowsdower! View Post
Oops! Sorry about that. Instead of commenting out the line just make these changes:

Code:
#navmenu li.current_page_item>a,  

#navmenu li.current-menu-item>a,
#navmenu2 li.current_page_item>a,  

#navmenu2 li.current-menu-item>a {

	color: #000;

}
That makes it apply only to anchor tags that are the IMMEDIATE child of the "current" <li> element.
Got it! Thank you!!
krispol is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Advertisement
Log in to turn off these ads.