[Resolved] Changing Background Color for a Specific Menu Item

Home Forums Support [Resolved] Changing Background Color for a Specific Menu Item

Home Forums Support Changing Background Color for a Specific Menu Item

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #414681
    robmac

    Hi Tom/Leo,

    Re the Main Menu Item at the URL provided. I’d like to please change the background color of the specific menu item in question, ie, “Hot Deals”, I’ve used other Help forum threads to come-up with the code below, which isn’t right, could suggest any refinement please?

    .main-navigation .main-nav ul li#643 a {
    background-color: #CB4335;
    }

    Thanks for any help offered.

    Regards,
    Robert

    #414683
    robmac

    Follow-up slightly more ambitious code below ????

    .main-navigation .main-nav ul li#643 a {
    background-color: #CB4335;
    background-hover: #1D8348;
    }

    Thank you.

    #414692
    Tom
    Lead Developer
    Lead Developer

    It would be better to give the menu item a class: https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

    Then do this:

    .main-navigation .main-nav ul li.your-custom-class a {
        background-color: #CB4335;
    }
    
    .main-navigation .main-nav ul li.your-custom-class a:hover {
        background-color: #1D8348;
    }
    #415719
    robmac

    Thank you Tom…..worked well!

    #415842
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #915515
    Alban

    It’s a past post but just THANKS !!!

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