Archived topic
Exclude CSS for a specific menu-item
3 replies · Started by Henk on January 11, 2022
Hi,
When hovering over the main navigation I display a blue line underneath the text of the menu item.
This works perfectly with the code below.
But I would like to exlude the menu item with the class name nav-button.
How can I do that? I tried different :not() variations but I can't find the correct one.
`.main-navigation .main-nav ul li > a:hover,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
border-bottom: 3px solid #39c;
}`
Thanks, Henk.
Hi there,
Try editing your CSS to this:
.main-navigation .main-nav ul li:not(.nav-button) > a:hover,
.main-navigation .main-nav ul li:not(.nav-button)[class*="current-menu-"] > a {
border-bottom: 3px solid #39c;
}
Let me know if this helps :)
Yes.
Thanks Leo.
No problem :)