Archived topic
Primary Nav Item for Current Hover
9 replies · Started by Ian on September 17, 2020
Right now, I have set Background Current to none. Let's say we are on the home page. Is there a way to still make the Home link have a background hover?
Hi Ian,
I am not sure I completely understand.
Did you mean, adding background color to the home link on the site's navbar when it is the current page? But not for the other pages?
Let me try this again. When a user is on the home page, hovering over the Home item in the primary nav does not trigger the background hover. Can this be enabled?
Try this CSS:
.main-navigation .main-nav ul li[class*="current-menu-"] > a:hover {
background-color: #fff;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let us know if this helps :)
Hey Leo,
Do I run that as is? No bg colour is showing up on hover. If I have to change class, please share some details. Thanks!
Shouldn't need to change the code at all.
Can you link me to the page in question with the CSS added and caching plugin cleared and disabled?
Let me know :)
I can't create a log in and site is under dev mode. Do any customizer settings that need to be set to make this code work. I have tried various options for BG colour for current and hover and this code does not seem to take.
Hi there,
try:
.main-navigation .main-nav ul li[class*="current-menu-"]:hover > a {
background-color: #fff !important;
}
Thanks David. That worked like a charm!
Glad to be of help