- This topic has 39 replies, 13 voices, and was last updated 6 years, 7 months ago by
Leo.
-
AuthorPosts
-
July 25, 2017 at 6:51 am #354605
RISE Websites
It works great on pc thanks !!
But on mobile the line is on top of the menu title and not under…
How can I correct this ?Thanks !!
July 25, 2017 at 8:21 am #354636Leo
StaffCustomer SupportHi there,
Try making it desktop only:
@media (min-width:769px) { .main-navigation .menu > .menu-item > a::after { content: ""; position: absolute; right: 0; left: 50%; bottom: 15px; -webkit-transform: translateX(-50%); transform: translateX(-50%); display: block; width: 0; height: 2px; background-color: currentColor; transition: 0.3s width ease; } .main-navigation .menu > .menu-item.current-menu-item > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; } }July 25, 2017 at 10:43 am #354739RISE Websites
Works perfect ! thanks again !!
July 25, 2017 at 11:08 am #354746Leo
StaffCustomer SupportNo problem!
August 15, 2017 at 11:42 am #366595Michael
Wow, this is exactly what I was looking for! Thank you, Luiz!
It works really well but on menu items that include a drop-down cursor, the underline is centred and underlines the cursor as well. Would there be a way just to underline the text?
Thank you!
August 15, 2017 at 2:43 pm #366749Tom
Lead DeveloperLead DeveloperAny chance you can link me to the page where it’s happening?
Thanks! 🙂
August 15, 2017 at 3:01 pm #366766Michael
Hi Tom,
My site isn’t live yet. Is there a way for me to share it with you?
Thanks!
August 15, 2017 at 3:32 pm #366785Leo
StaffCustomer SupportYou can send it though Account Issue here: https://generatepress.com/contact/
August 26, 2017 at 9:14 am #373825Krzysztof
Update question: how to modify the code so that the currently selected menu item stays underlined?
August 26, 2017 at 10:46 am #373867Tom
Lead DeveloperLead DeveloperThe CSS above should do that by default: https://generatepress.com/forums/topic/animating-link-underlines-for-main-menu/page/2/#post-354636
If it’s not, can you link us to your site?
Thanks!
August 26, 2017 at 11:34 am #373887Krzysztof
August 26, 2017 at 5:50 pm #373975Tom
Lead DeveloperLead DeveloperI’m not seeing this part:
.main-navigation .menu > .menu-item.current-menu-item > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; }If it’s there, can you disable Autoptimize so I can take a look?
August 27, 2017 at 12:33 am #374076Krzysztof
Works! Thx 🙂
August 27, 2017 at 9:43 am #374228Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
November 22, 2017 at 10:53 am #430869James
Hey, quick question. I know this is an old question, but I was wondering, is there a way to make it to where one of my menu items is not underlined? I have my logo in the center of the nav between menu items, and I’d like that to not be underlined. I know I can add a class to the logo, something like .center-logo.
Thanks for any help.
Best,
James -
AuthorPosts
- The topic ‘Animating link underlines for main menu’ is closed to new replies.