- This topic has 5 replies, 3 voices, and was last updated 3 years, 10 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
June 3, 2020 at 9:10 am #1312847Kevin
I am using following code for navigation underline
@media (min-width:769px) { /* Menu Hover underline animation */ .main-navigation .menu > .menu-item.menu-hover > a::after { content: ""; position: absolute; right: 15%; left: 50%; bottom: 15px; -webkit-transform: translateX(-50%); transform: translateX(-50%); display: block; width: 0; height: 2px; background-color: #1a3354; transition: 0.3s width ease; } .main-navigation .menu > .menu-item.menu-hover.current-menu-item:not(.exclude-hover) > a::after, .main-navigation .menu > .menu-item.menu-hover > a:hover::after { width: 70%; } }
How do you change the css so underline goes from left to right and covers 100% of the menu text from left to right?
I would like it exactly like following
June 3, 2020 at 4:32 pm #1313334TomLead DeveloperLead DeveloperHi there,
Hard to test without a link to your site, but you could copy their code exactly and add it to our markup:
.main-navigation .main-nav > ul > li > a { position: relative; } .main-navigation .main-nav > ul > li > a:after { content: ''; position: absolute; width: 0; height: 3px; display: block; margin-top: 5px; right: 0; background: #fff; transition: width .2s ease; -webkit-transition: width .2s ease; } .main-navigation .main-nav > ul > li:hover > a:after, .main-navigation .main-nav > ul > li.sfHover > a:after { width: 100%; left: 0; }
That should give you the same result.
June 3, 2020 at 6:40 pm #1313419KevinTried it but does not work.
I put a link to the site in original post.June 4, 2020 at 3:36 am #1313806DavidStaffCustomer SupportCan you remove any other CSS related to hover effects on the navigation and we can take a look
June 4, 2020 at 9:41 pm #1315012KevinHere are the codes just in case anyone needs it
@media (min-width:769px) { /* Menu Hover underline animation */ .main-navigation .menu > .menu-item.menu-hover > a::after { content: ""; position: relative; right: 15%; left: 0%; bottom: 15px; -webkit-transform: translateX(100%); transform: translateX(0%); display: block; width: 0; height: 2px; background-color: #1a3354; transition: 0.3s width ease; } .main-navigation .menu > .menu-item.menu-hover.current-menu-item:not(.exclude-hover) > a::after, .main-navigation .menu > .menu-item.menu-hover > a:hover::after { width: 90%; } }
June 5, 2020 at 3:45 am #1315288DavidStaffCustomer SupportThanks for sharing
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.