Archived topic
Changing Background Color for a Specific Menu Item
5 replies · Started by robmac on November 1, 2017
Hi Tom/Leo,
Re the Main Menu Item at the URL provided. I'd like to please change the background color of the specific menu item in question, ie, "Hot Deals", I've used other Help forum threads to come-up with the code below, which isn't right, could suggest any refinement please?
.main-navigation .main-nav ul li#643 a {
background-color: #CB4335;
}
Thanks for any help offered.
Regards,
Robert
Follow-up slightly more ambitious code below ????
.main-navigation .main-nav ul li#643 a {
background-color: #CB4335;
background-hover: #1D8348;
}
Thank you.
It would be better to give the menu item a class: https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
Then do this:
.main-navigation .main-nav ul li.your-custom-class a {
background-color: #CB4335;
}
.main-navigation .main-nav ul li.your-custom-class a:hover {
background-color: #1D8348;
}
Thank you Tom.....worked well!
You're welcome :)
It's a past post but just THANKS !!!