[Resolved] Primary Nav Item for Current Hover

Home Forums Support [Resolved] Primary Nav Item for Current Hover

Home Forums Support Primary Nav Item for Current Hover

  • This topic has 9 replies, 4 voices, and was last updated 1 year ago by David.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1447894
    Ian

    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?

    #1447914
    Elvin
    Staff
    Customer Support

    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?

    A wise man once said:
    "Have you cleared your cache?"

    #1447919
    Ian

    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?

    #1447947
    Leo
    Staff
    Customer Support

    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 ๐Ÿ™‚

    #1447973
    Ian

    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!

    #1447975
    Leo
    Staff
    Customer Support

    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 ๐Ÿ™‚

    #1448123
    Ian

    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.

    #1448332
    David
    Staff
    Customer Support

    Hi there,

    try:

    .main-navigation .main-nav ul li[class*="current-menu-"]:hover > a {
        background-color: #fff !important;
    }
    #1449000
    Ian

    Thanks David. That worked like a charm!

    #1449024
    David
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.