Jump to content
Sign in to follow this  
ddave

Text color in main nav in a sub page

Recommended Posts

ddave

Hi everyone, I have a small problem with the customisation of background color in main navigation when i am on a page other as homepage. Check this picture : http://hpics.li/e83fb38 The background menu selected stay in black grrr... (with the homepage the background menu come back to white when mouseout) The more strange is on homepage i haven't this pb, but for each

http://www.mysite.com/page
or
http://www.mysite.com/page/subpage

it have this troubleshooting. I am sure that it need to add something in custom CSS but i don't see wich lines to use... Warm regards, DDave

Share this post


Link to post
Share on other sites
catrina

This CSS should help for changing the background color from black to something else:

li.page_item a:hover {background-color: #YOURCOLORHERE;}

Add the hex code for the color you desire.

for each http://www.mysite.com/page or http://www.mysite.com/page/subpage it have this troubleshooting.
Can you describe in detail what kind of troubleshooting you need to do? Is it a 404 error?

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
ddave

Dear Catrina, Thanks for your reply. I think it's more complicated because i know use the CSS to change color background for li.page_item. (here i have put a white color). The pb is why black background stay on all pages apart the homepage... Look this picture : Eg4xD.jpg (my homepage) and compare to the first : http://hpics.li/e83fb38 ( an another page) On my homepage, i haven't this pb with background color, but when i am on an another page, the menu selected stay in black :'( (when i go into the submenu). When i look firebug i see one different thing beetween the index and other pages in the main navagiation. on home page, each page with subpages menu have a li class like that

	
	
class
current_page_item
in full code :
<li class="[b]page_item page-item-580 current_page_item[/b]">anything[/code]

	
	BUT on other pages (ex : a subpage) it's not the same.
	
	It's :
[code]<li class="[b]page_item page-item-31 current_page_ancestor current_page_parent[/b]">anything

I am not sure but the pb come from maybe to this class. I don't know how to remplace this class for others pages... or maybe just change something in CSS custom code about these class. Warm regards, DDave

Share this post


Link to post
Share on other sites
catrina

Ah, I missed the "current page item" bit. You can try adding this code so that the current page item background doesn't turn black in the subpages:

ul.main-nav li.current_page_item a {background-color: #ff0000;}
Change
ff0000

to the color of your choice.


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
ddave

Dear Catrina I have tried your tips about ul.main-nav..., it works on homepage, but not for the others :'( arrghhh ^^ The only other CSS custom codes that i used for the navigation is :

#primary-nav .main-nav li a:hover { color: #ffffff 

} Warm regards, DD

Share this post


Link to post
Share on other sites
catrina

Hm, I'm not sure why the CSS provided above wouldn't work in the subpages. When I view your subpages, the "current item" background color remains white. Do you want it to be black instead?


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
ddave

It remains white when you stay on homepage, but do you have done the test after you are going into an another page (like livres, a subpage..). In my web navigator (Chrome & Firefox) the current item stays black...

Share this post


Link to post
Share on other sites
catrina

The menu item remains black in the middle of page loading when I click on the subpage links. Is this what you're referring to?


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
ddave

I refer to the current item background is black and normally it need to remais white, like when you are on homepage. Like you have see the current item background color remais white when you are on homepage like here : Eg4xD.jpg but unfortunaltly not when youre on other page (livre, into a subpage of the website, etc...) --> http://hpics.li/e83fb38 Warm regards, Damien

Share this post


Link to post
Share on other sites
kastelic

Hey, I can't see a link to your site.

Share this post


Link to post
Share on other sites
ddave

Dear Jimmy, Sorry, the website is under construction and i have put a coming soon page, so each time, i need to desactivate and re-activate when i want to show the website. So, if you want to take a look about the troubleshooting, i will put a link and desactivate the plugin. Regards, DDave

Share this post


Link to post
Share on other sites
Kate

Hey DDave, I believe the issue here is just declaring the right selector. Once you go to a subpage and still see the main item highlighted in black, check what the class of that main item (that's highlighted) is. It should be something like "current-page-ancestor". All you need to do add that class to the CSS Catrina gave you earlier. Make sense?

Share this post


Link to post
Share on other sites
ddave

Dear Kate, Thanks for your advices. You and Catrina have give me the solution. The pb was on two classes :

current_page_ancestor
and
sf-menu
. So the solution is to add two line in CSS custom :
ul.sf-menu li a { background-color: #ffffff }
ul.main-nav li.current_page_ancestor a  { background-color: #ffffff }

I have try these options before but without the "a" element ... grrr! It's always like that, you pass always so close of the solution and turn around during some hours. Thanks to u and Catrina to spend your time on my troubleshooting. Regards, DDave

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  

×