[Resolved] Active navigation change to a different colors

Home Forums Support [Resolved] Active navigation change to a different colors

Home Forums Support Active navigation change to a different colors

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #165729
    Julia

    Hi Support!

    I want my nav to be all white, except for when a page is active or hovered. Then I want them to have different colors. I want the drop down-menu to be the same color as the active page bar.

    I’ve tried different things, but it doesnt work…

    I’ve given each page a class, but what do I do next?

    Thanks

    Julia

    #165730
    Julia

    Forgot to ad: I have a child theme!

    #165799
    Tom
    Lead Developer
    Lead Developer

    Hi Julia,

    The best and easiest way is to use the Colors add-on – it lets you do this all through the customizer.

    Otherwise, you can use the current-menu-item class:

    .main-navigation .main-nav ul li.current-menu-item a {
          background-color: yellow; /* or use a hex code to be more specific */
          color: #000000; /* this is the text color */
    }
    #165831
    Julia

    Hmm, it changes the color, but not in the way I want. I want it to change color when you hover the page link or when you’re on that page. Sorry for my english.

    Solved the hover problem with:

    .main-navigation .main-nav li.home a:hover {
    background-color: yellow; /* or use a hex code to be more specific */
    color: #000000; /* this is the text color */
    }

    but how do I do if I want it to stay yellow, and not darkgrey like the default settings?

    Thanks,

    Julia

    #165855
    Tom
    Lead Developer
    Lead Developer

    When do you want it to be yellow? All the time? When you’re on the page?

    #165859
    Julia

    When I’m on that page.

    #165860
    Tom
    Lead Developer
    Lead Developer

    My code here will apply to any menu item when you’re on the page: https://generatepress.com/forums/topic/active-navigation-change-to-a-different-colors/#post-165799

    This code will apply to your .home menu item when on the page:

    .main-navigation .main-nav ul li.home.current-menu-item a {
          background-color: yellow; /* or use a hex code to be more specific */
          color: #000000; /* this is the text color */
    }
    #165889
    Julia

    Perfect! THANK YOU!

    #165933
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.