Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1372196

    Hi,

    I have currently custom css for highlighting an active menu item (https://prnt.sc/NnQmp-CpyYrw) but can you tell me how to proper center the text in the box? Now it seems there is more space on the right (https://prnt.sc/ZE7TAVONcJQE). Also when I just hover over another menu item the yellow just change a bit liter. Can you add to the code that when I hover over the menu items, the color of the menu item also changes to green #003D1D ?

    Can you also share me the css code for just underlying the active menu item instead of boxing it?
    Thanks!!

    .av-main-nav li.current_page_parent > a .avia-menu-text,
    #top.woocommerce-page .av-main-nav li#menu-item-3184 .avia-menu-text {
    border: 1px solid rgba(0,61,29) !important;
    margin-left: 1px !important;
    padding: 5px !important;
    background-color: rgba(0,0,0,0) !important;
    border-radius: 4px !important;
    color: #003D1D !important;
    }

    #1372207

    Hey mvanstee,
    Thank you for the link to your page, your Home menu item with the outline around it looks off center because the 5px letter-spacing adds 5px after each letter, so the H is flush to the padding on the left, but the E has an extra 5px letter-spacing before the padding on the right. To correct I recommend removing the 5px padding on the right, so in your css above change the padding to this:
    padding: 5px 0 5px 5px !important;
    To display the underline add this css:

    .av_minimal_header #header_main .avia-menu-fx {
        display: block;
    }

    To change the hover menu item color add this css:

    #top #header #avia-menu .menu-item:hover > a > .avia-menu-text {
        color: #003D1D;
    }
    

    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1372213

    Hi Mike,

    Thanks! I have now:

    /* Highlight menu item*/

    .av-main-nav li.current_page_parent > a .avia-menu-text,
    #top.woocommerce-page .av-main-nav li#menu-item-3184 .avia-menu-text {
    border: 1px solid rgba(0,61,29) !important;
    margin-left: 1px !important;
    padding: 5px 0 5px 5px !important;
    background-color: rgba(0,0,0,0) !important;
    border-radius: 4px !important;
    color: #003D1D !important;
    }
    #top #header #avia-menu .menu-item:hover > a > .avia-menu-text {
    color: #003D1D;
    }

    ==> The menu items are still a bit off center. Can you review my code please and tell me what I’ve missed? Thanks 🙏 😊 ☺️ 🤩

    #1372218

    Hi,
    I’m seeing this css:

    #header .av-main-nav .current-menu-item > a > .avia-menu-text {
        border: 1px solid rgba(0,61,29) !important;
        margin-left: 1px !important;
        padding: 5px !important;
        background-color: rgba(0,0,0,0) !important;
        border-radius: 4px !important;
    }

    note the padding is still padding: 5px !important; please note that this is a different rule than the one you posted above, as I look closer you have two rules that are very similar, so please look for this one.

    Best regards,
    Mike

    #1372219

    I’m confused, can you please give me the full css which I need to copy/paste so my menu items are centered in the box?

    I have now:
    /* Highlight menu item*/

    .av-main-nav li.current_page_parent > a .avia-menu-text,
    #top.woocommerce-page .av-main-nav li#menu-item-3184 .avia-menu-text {
    border: 1px solid rgba(0,61,29) !important;
    margin-left: 1px !important;
    padding: 5px 0 5px 5px !important;
    background-color: rgba(0,0,0,0) !important;
    border-radius: 4px !important;
    color: #003D1D !important;
    }
    #top #header #avia-menu .menu-item:hover > a > .avia-menu-text {
    color: #003D1D;
    }

    >> please edit and copy the whole css code in your answer so I can copy/paste yours. Thnx!!

    #1372256

    Hi,
    Please try this, after applying the css, please clear your browser cache and check.

    #top #header #header_main .av-main-nav .current-menu-item > a > .avia-menu-text {
        border: 1px solid rgba(0,61,29) !important;
        margin-left: 1px !important;
        padding: 5px 0 5px 5px !important;
        background-color: rgba(0,0,0,0) !important;
        border-radius: 4px !important;
    }
    #top #header #avia-menu .menu-item:hover > a > .avia-menu-text {
        color: #003D1D;
    }

    If this doesn’t help please include an admin login in the Private Content area so we can be of more assistance.

    Best regards,
    Mike

    #1372261

    Thanks Mike! nope…your code doesn’t work and also the green hover effect doesn’t work anymore after applying your code

    #1372297

    Hi,
    Please include an admin login in the Private Content area so I can check your css.

    Best regards,
    Mike

    #1372346

    Hi, can you tell me how to remove the box around the active menu item and replace it by an underline effect (https://prnt.sc/4L5kxCXJHPIU) ?

    #1372348

    Hi,
    To add the underline effect please add this css:

    .av_minimal_header #header_main .avia-menu-fx {
        display: block;
    }

    The border around your menu item is added by your css: border: 1px solid rgba(0,61,29) !important;
    but you have the same css added twice so you will need to remove both of them:
    2022-11-12_004.png
    this is also the reason the padding issue with the menu text, in one place you corrected the padding to padding: 5px 0 5px 5px !important; but not in the other place, this is why I asked for a login to help you remove this other css.

    Best regards,
    Mike

    #1372390
    This reply has been marked as private.
    #1372422

    Hi,
    Thanks for the login, I removed your duplicate css and adjusted the remainder css so instead of having a box around the active menu item it now is green with a green line under it.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1372481

    Thnx Mike! Looks better now, but line under the home-item is still a bit off-centered… https://prnt.sc/886hxB9vDvrv >> Can you also fix this?

    #1372618

    Dear, any update on this? Thanks!

    #1372644

    Hi,
    Thank you for your patience, this is trickier but I added this css and it seems to help:

    #top #header #avia-menu #menu-item-3181 .avia-menu-text {
    	margin-right:-5px;
    }

    please clear your browser cache and check.

    Best regards,
    Mike

    #1372749

    Works! Thanks

    #1372754

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Highlight menu item’ is closed to new replies.