Custom secondary menu - by MJ - on WordPress WooCommerce support

This topic has 3 replies, 2 voices, and was last updated 4 years, 3 months ago ago by MJ

  • Avatar: MJ
    MJ
    Participant
    August 27, 2021 at 06:56

    Hi
    I have created the secondary menu for my site and use below CSS to style it. it is working well, but the issue is it effects other menus in the page. for example i made a menu with widget in header and it gets the exact style which i dont want. https://prnt.sc/1qld4pv

    how can i turn below CSS into a class type code that be used only on specific menu. Or any other solution to exclude below code from other menus in the website.

    /* Secondary menu */
    .menu-element .menu li>a:hover {
    background-color: #e1e1e1;
    border-radius: 6px;
    }
    .menu-element .menu li>a {
    margin-top:10px;
    margin-bottom:5px;
    line-height:1.2em;
    font-weight:400;
    font-size:14px;

    }

    .menu-element .menu-item .item-link{
    padding-right:7px;
    padding-left:7px;
    padding-top:5px;
    padding-bottom:5px;
    }

    Please, contact administrator
    for this information.
    2 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 27, 2021 at 13:31

    Hello,

    Change this “.menu-element” https://gyazo.com/384d0c02bc9f68a15eb2cd293f854ea7 to “custom-menu-element” (without dot).
    Then change menu-element in your custom CSS code to: custom-menu-element, for example – https://gyazo.com/8a0b8b2d970807522b5fd71f28606d58

    Regards

    Avatar: MJ
    MJ
    Participant
    August 27, 2021 at 13:40

    That is perfect. Thank you

  • Viewing 3 results - 1 through 3 (of 3 total)

The issue related to '‘Custom secondary menu’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.