
-
AuthorPosts
-
November 11, 2022 at 1:08 pm #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;
}November 11, 2022 at 1:53 pm #1372207Hey 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,
MikeNovember 11, 2022 at 2:18 pm #1372213Hi 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 🙏 😊 ☺️ 🤩
November 11, 2022 at 2:32 pm #1372218Hi,
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,
MikeNovember 11, 2022 at 2:53 pm #1372219I’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!!
November 11, 2022 at 7:37 pm #1372256Hi,
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,
MikeNovember 11, 2022 at 8:29 pm #1372261Thanks Mike! nope…your code doesn’t work and also the green hover effect doesn’t work anymore after applying your code
November 12, 2022 at 2:33 pm #1372297Hi,
Please include an admin login in the Private Content area so I can check your css.Best regards,
MikeNovember 12, 2022 at 9:38 pm #1372346Hi, 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) ?
November 12, 2022 at 10:00 pm #1372348Hi,
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:
this is also the reason the padding issue with the menu text, in one place you corrected the padding topadding: 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,
MikeNovember 13, 2022 at 11:42 am #1372390This reply has been marked as private.November 13, 2022 at 6:26 pm #1372422Hi,
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,
MikeNovember 14, 2022 at 9:59 am #1372481Thnx 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?
November 15, 2022 at 9:37 am #1372618Dear, any update on this? Thanks!
November 15, 2022 at 2:22 pm #1372644Hi,
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,
MikeNovember 16, 2022 at 12:36 pm #1372749Works! Thanks
November 16, 2022 at 12:57 pm #1372754Hi,
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 -
AuthorPosts
- The topic ‘Highlight menu item’ is closed to new replies.