Archived topic
Background hovering color of a "transparent" background menu
7 replies · Started by Kle on April 21, 2018
Hi there,
I have a trasnparent background for a menu item to avoid being higlighted (with the Background Current feature) when a visitor is in that specific page. The problem is that if it has sumbenus, when hovering over the submenus the "primary" menu item (from which the submenu belongs to) goes trasnparent and not the hovering color I have asigned to it's background.
How can I have it to show the backround color when hovering over the submenus while also trasnparent when a visitor is in that page?
This is how I have it now:
#menu-item-1747 a {
background-color: transparent;
color: #595959;
}
#menu-item-1747 a:hover {
color: #FFFFFF;
background-color: #E5E5E5;
}
Thank you:)
Hi there,
What if you replace:
#menu-item-1747 a:hover
With:
#menu-item-1747:hover a
Thank you Tom, almost there:)
Just one thing, the submenu gets the backgrounf highlited with the same color as the primary menu. What is the css code to give the submenu a different background color (as the rest of my menu) and that also changes when hovering over?
Sub-menus have their own color options in "Customize > Colors > Primary Navigation".
Let me know if that helps or not :)
I´ve been using that feature since day 1:) but with this css intervention we've made the menu/submenu gets funky when hovering. The submenu won't change the color neither the primary menu. They just go grey and won't take the customizer settings.
If you could take a quick look at my site you'll see what I mean. I have another item right besides it that has a submenu and that one displays correctly the settings I have made with the customizer and would like the other item to behave like that as well.
Thank you:)
Ah, gotcha. Try this as your CSS:
#menu-item-1747 .main-nav > ul > li > a {
background-color: transparent;
color: #595959;
}
#menu-item-1747 .main-nav > ul > li:hover > a {
color: #FFFFFF;
background-color: #E5E5E5;
}
Perfect!! Thank you Tom!
You're welcome :)