PatrickC Posted July 9, 2019 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
Beyondspace Posted June 20, 2020 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; } BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
pinoff002 Posted September 1, 2020 Posted September 1, 2020 Hey! Code available for this using 7.1? Thanks!
Beyondspace Posted September 1, 2020 Posted September 1, 2020 58 minutes ago, pinoff002 said: Hey! Code available for this using 7.1? Thanks! Pls show your site url BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
pinoff002 Posted September 1, 2020 Posted September 1, 2020 2 hours ago, bangank36 said: Pls show your site url https://thisisaspace.com/
nickleb Posted September 19, 2020 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?
tuanphan Posted September 21, 2020 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 Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
nickleb Posted September 27, 2020 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.
studiofounded Posted November 18, 2021 Posted November 18, 2021 Hi! Is this a way to add this code to regular text links in 7.1? A brand designer & strategist creating brands that bridge the gaps between artistry, strategy, and thoughtful consideration. Creator of Studio Founded, a digital resource library for purposeful business owners. 💻 Shop Squarespace Templates ✍️ Curated Business Resources 🥰 Complimentary Downloadables 🤍 Bespoke Branding & Websites Links in my posts may be affiliate links.
tuanphan Posted November 20, 2021 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 Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
studiofounded Posted November 20, 2021 Posted November 20, 2021 Yes, you can try it on this site, password demo. https://mackerel-flatworm-m6lh.squarespace.com/ A brand designer & strategist creating brands that bridge the gaps between artistry, strategy, and thoughtful consideration. Creator of Studio Founded, a digital resource library for purposeful business owners. 💻 Shop Squarespace Templates ✍️ Curated Business Resources 🥰 Complimentary Downloadables 🤍 Bespoke Branding & Websites Links in my posts may be affiliate links.
tuanphan Posted November 23, 2021 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 Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
DBLPJ Posted February 25, 2022 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
tuanphan Posted February 27, 2022 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 Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment