PatrickC Posted July 9, 2019 Share Posted July 9, 2019 (edited) I am trying to make an animated underline on hover. would be nice if the underline remained for the active page. I found this but the underline is miles away from the navigation and does not stay on for the active page..... Anybody have any suggestions? Much appreciated.. .Header-nav-item { position:relative; height: 60px; line-height: 60px; text-align: center; transition: 0.5s; padding: 0 20px; cursor: pointer; -webkit-transition:0.5s;} .Header-nav-item:hover { background-color: transparent; border-color: transparent; color: #000000;} .Header-nav-item:hover:before{ transition-delay: .2s; } .Header-nav-item:before{ width: 0%; height:100%; z-index: 3; content:''; position: absolute; bottom:-1px; left:0; box-sizing: border-box; transition: .2s;} .Header-nav-item:hover:before { width: 100% !important; transition: .7s; } .Header-nav-item:before { border-bottom: 2px solid #000000;} Edited July 9, 2019 by PatrickC Active page Link to comment
Beyondspace Posted June 20, 2020 Share Posted June 20, 2020 Your snippet seems worked well, I edit it to match the needs .Header-nav-item { position: relative; height: 60px; line-height: 60px; text-align: center; transition: 0.5s; padding: 0 20px; cursor: pointer; -webkit-transition: 0.5s; } .Header-nav-item:hover { background-color: transparent; border-color: transparent; color: #000000; } .Header-nav-item:hover:before { transition-delay: .2s; } .Header-nav-item:before { width: 0%; height: 100%; z-index: 3; content: ''; position: absolute; top: -20px; left: 0; box-sizing: border-box; transition: .2s; } .Header-nav-item:hover:before, .Header-nav-item.Header-nav-item--active:before { width: 100% !important; transition: .7s; } .Header-nav-item:before { border-bottom: 2px solid #000000; } Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
pinoff002 Posted September 1, 2020 Share Posted September 1, 2020 Hey! Code available for this using 7.1? Thanks! Link to comment
Beyondspace Posted September 1, 2020 Share Posted September 1, 2020 58 minutes ago, pinoff002 said: Hey! Code available for this using 7.1? Thanks! Pls show your site url Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
pinoff002 Posted September 1, 2020 Share Posted September 1, 2020 2 hours ago, bangank36 said: Pls show your site url https://thisisaspace.com/ Link to comment
nickleb Posted September 19, 2020 Share Posted September 19, 2020 On 6/20/2020 at 9:58 AM, bangank36 said: Your snippet seems worked well, I edit it to match the needs .Header-nav-item { position: relative; height: 60px; line-height: 60px; text-align: center; transition: 0.5s; padding: 0 20px; cursor: pointer; -webkit-transition: 0.5s; } .Header-nav-item:hover { background-color: transparent; border-color: transparent; color: #000000; } .Header-nav-item:hover:before { transition-delay: .2s; } .Header-nav-item:before { width: 0%; height: 100%; z-index: 3; content: ''; position: absolute; top: -20px; left: 0; box-sizing: border-box; transition: .2s; } .Header-nav-item:hover:before, .Header-nav-item.Header-nav-item--active:before { width: 100% !important; transition: .7s; } .Header-nav-item:before { border-bottom: 2px solid #000000; } Hi there! Just wondering where would I insert code if I wanted to change the color of the line animation? So if I wanted it to go from green to blue? Link to comment
tuanphan Posted September 21, 2020 Share Posted September 21, 2020 On 9/20/2020 at 5:02 AM, nickleb said: Hi there! Just wondering where would I insert code if I wanted to change the color of the line animation? So if I wanted it to go from green to blue? change #000000 in above code Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
nickleb Posted September 27, 2020 Share Posted September 27, 2020 On 9/21/2020 at 7:57 AM, tuanphan said: change #000000 in above code thank you. also i noticed this code moves the entire navigation menu down and i can't seem to figure out how to not make that happen. Link to comment
studiofounded Posted November 18, 2021 Share Posted November 18, 2021 Hi! Is this a way to add this code to regular text links in 7.1? Link to comment
tuanphan Posted November 20, 2021 Share Posted November 20, 2021 On 11/18/2021 at 7:41 PM, HannahRoseShaw said: Hi! Is this a way to add this code to regular text links in 7.1? Can you share link to page where you added a text link? We will try testing the code easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
studiofounded Posted November 20, 2021 Share Posted November 20, 2021 Yes, you can try it on this site, password demo. https://mackerel-flatworm-m6lh.squarespace.com/ Link to comment
tuanphan Posted November 23, 2021 Share Posted November 23, 2021 On 11/18/2021 at 7:41 PM, HannahRoseShaw said: Hi! Is this a way to add this code to regular text links in 7.1? Add to Design > Custom CSS /* Links underline hover */ .content-wrapper a { text-decoration: none; position: relative; } .content-wrapper a:after { content: ""; height: 1px; width: 0; position: absolute; background-color: black; left: 0; bottom: 0; transitioN: all 0.3s; } .content-wrapper a:hover:after { transition: all 0.3s; width: 100%; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
DBLPJ Posted February 25, 2022 Share Posted February 25, 2022 Hello, I like to know how I can add a underline animation while hovering and when I click the link the link will stay underlined till I click another link in the site header. Is this possible? Please help. Kind regards, Pascal Link to comment
tuanphan Posted February 27, 2022 Share Posted February 27, 2022 On 2/25/2022 at 10:17 PM, DBLPJ said: Hello, I like to know how I can add a underline animation while hovering and when I click the link the link will stay underlined till I click another link in the site header. Is this possible? Please help. Kind regards, Pascal What is your site url? We can give tweaked code easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment