- This topic has 14 replies, 2 voices, and was last updated 8 years, 1 month ago by Tom.
-
AuthorPosts
-
February 26, 2016 at 9:36 am #175472Mary Pearson
Hi Tom,
In my navigation bar I have my main menu background colour set to #3399cc with #fff for text of the active link, however it doesn’t work for the Forums link – I assume because it’s a different kind of link.
Am assuming that I need to treat this one link .menu-item-809 in Custom CSS but I don’t know how to do it.
Can you help?
Many thanks!
February 26, 2016 at 12:05 pm #175524TomLead DeveloperLead DeveloperYour colors should apply to all menu items – doesn’t matter what they are.
Can I see?
February 26, 2016 at 1:26 pm #175546Mary PearsonYes of course. If you go to the website at https://christiangayschat.com/ and click on any of the links, for example “Registration”, you will see that the link changes from blue text on white background to white text on blue background.
You have to be logged in as a member to see the Forums page but I’ve put a screenshot at https://christiangayschat.com/test/
You will see that the page selected is “Forums” but the background colour of the link is white, like all the unselected pages.
If you want access to the site, let me know where I can send you confidential information.
February 26, 2016 at 9:46 pm #175613TomLead DeveloperLead DeveloperThat doesn’t look like a menu item, it’s the title of the page?
February 27, 2016 at 7:53 am #175688Mary PearsonHi Tom,
Yes indeed it was a screenshot of the Forums page – the page that is active. The purpose was to show you that when that page is active the background of the link remains white instead of turning blue. I have now uploaded screenshots of the links from Home page and Registration page that work properly. Under that is the Forums page that has the problem. Please take another look with the new screenshots.
- This reply was modified 8 years, 1 month ago by Mary Pearson.
February 27, 2016 at 11:10 pm #175827TomLead DeveloperLead DeveloperYou can do this (assuming you’re using bbpress):
.bbpress .main-navigation .main-nav ul .menu-item-809 > a { background-color: #whatever; color: #FFF; }
- This reply was modified 8 years, 1 month ago by Tom.
- This reply was modified 8 years, 1 month ago by Tom.
February 28, 2016 at 5:59 am #175895Mary PearsonThanks Tom. The background is now blue but so is the text. I can’t get it to be white. I’ve tried it in Safari, Firefox and Chrome – same thing for all of them – blue text on blue background.
I have verified that I copied and pasted your code correctly. I just changed the colour.
/* Menu Forums – when active background colour is #3399cc */
.bbpress .menu-item-809 {
background-color: #3399cc;
color: #FFF;
}February 28, 2016 at 6:02 am #175896Mary PearsonI just noticed too that if I click on a sub-link within Forums, that the Forums link background remains white, as opposed to all the others. When I click on a sub-menu item in the others, the main menu item shows blue background.
February 28, 2016 at 11:17 am #175934TomLead DeveloperLead DeveloperI just adjusted the code above – can you give it a shot?
February 28, 2016 at 12:31 pm #175950Mary PearsonNo change in any of the browsers after dumping cache. Still blue on blue
February 28, 2016 at 10:41 pm #175993TomLead DeveloperLead DeveloperAdjusted it again – let me know π
February 29, 2016 at 5:48 am #176066Mary PearsonThanks Tom. That fixed it for clicking on the main Forums menu, but if I click on a sub-menu of Forums it reverts back to white background.
Is it possible to also make the main Forums link have a blue background when a (Forums) sub-menu page is selected?
February 29, 2016 at 9:44 pm #176188TomLead DeveloperLead DeveloperThat CSS will only work when you’re on a bbPress page.
If the other sub nav pages aren’t in bbPress, you need to add their page IDs to the selectors:
.bbpress .main-navigation .main-nav ul .menu-item-809 > a, .page-id-xx .main-navigation .main-nav ul .menu-item-809 > a, .page-id-xx .main-navigation .main-nav ul .menu-item-809 > a { background-color: #whatever; color: #FFF; }
xx being the ID of the pages.
March 1, 2016 at 6:20 am #176293Mary PearsonThank you so much Tom. What worked for all the links is the following:
/* Menu Forums β when active background colour is #3399cc */
.bbpress .main-navigation .main-nav ul .menu-item-809 > a,
.page-id-0 .main-navigation .main-nav ul .menu-item-809 > a {
background-color: #3399cc;
color: #FFF;
}(page-id-0 changes them all)
Thank again AWESOME TOM!!!
March 1, 2016 at 11:40 am #176379TomLead DeveloperLead DeveloperGlad I could help π
-
AuthorPosts
- You must be logged in to reply to this topic.