Dear Team
How to highlight the active Menu/Sub-Menu item (background/color)?
I tried
li.current-menu-item>a {
background-color: #d11242 !important;
color: white !important;
}
but then beside the main menu item several sub-menu items are highlighted because there is not just a single current_menu_item if the page loads.
Thanks for your advice.
Hi sophie_doblhoff!
Add this.
#top .sub-menu a { background-color: white !important; color: black !important; }
Best regards,
Elliott
Hi
Thanks for your message, that did not solve the problem.
The goal is to highlight the currently active menu-item / sub-menu-item. And the problem is, that several menu-items are “current_menu_item” when the page loads.
Any advice appreciated.
Hey!
Thanks for your message, we changed the first menu-item in Design/Menu from an “individual link” to a “site”.
Anyhow, this solved the problem, but I’m curious if there is a CSS based solution for our next projects? Highlighting the current menu-item / sub-menu-item is a common task, is there any best-practice based on your experience?
Best regards,
Soph