addisonpann Posted December 11, 2021 Share Posted December 11, 2021 Site URL: https://www.addisonpann.art/ Website password: toast I've applied an underline animation to my navigation links when they're in a hover state. This is the code I used: .header-nav-item--collection a { display: inline; position: relative; overflow: hidden; } .header-nav-item--collection a:after { content: ""; position: absolute; z-index: -1; right: 0; width: 0; bottom: -3px; background: #E19D9D; height: 1px; transition-property: width; transition-duration: 0.3s; transition-timing-function: ease-out; } .header-nav-item--collection a:hover:after, .header-nav-item--collection a:focus:after, .header-nav-item--collection a:active:after { left: 0; right: auto; width: 100%; } I'm looking to add this exact same animation to my pagination titles when hovered over, but haven't had any luck so far. Any help would be appreciated. 🙂 Link to comment
Solution Beyondspace Posted December 11, 2021 Solution Share Posted December 11, 2021 (edited) 2 hours ago, addisonpann said: Site URL: https://www.addisonpann.art/ Website password: toast I've applied an underline animation to my navigation links when they're in a hover state. This is the code I used: .header-nav-item--collection a { display: inline; position: relative; overflow: hidden; } .header-nav-item--collection a:after { content: ""; position: absolute; z-index: -1; right: 0; width: 0; bottom: -3px; background: #E19D9D; height: 1px; transition-property: width; transition-duration: 0.3s; transition-timing-function: ease-out; } .header-nav-item--collection a:hover:after, .header-nav-item--collection a:focus:after, .header-nav-item--collection a:active:after { left: 0; right: auto; width: 100%; } I'm looking to add this exact same animation to my pagination titles when hovered over, but haven't had any luck so far. Any help would be appreciated. 🙂 Try .item-pagination-link .item-pagination-title { position: relative; } .item-pagination-link .item-pagination-title:after { content: ""; position: absolute; right: 0; width: 0px; bottom: -3px; background: #e19d9d; height: 1px; transition-property: width; transition-duration: .3s; transition-timing-function: ease-out; left:0; right: auto; } .item-pagination-link:hover .item-pagination-title:after { width: 100%; } Let me know how it works on your site Press 👍 or mark this answer as solution to help another one too Edited December 11, 2021 by bangank36 tuanphan and addisonpann 1 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
addisonpann Posted December 11, 2021 Author Share Posted December 11, 2021 7 hours ago, bangank36 said: Let me know how it works on your site You've done it again. Thanks a bunch, @bangank36. How do you know which selectors to use? Are you just doing right click > inspect? Link to comment
Beyondspace Posted December 12, 2021 Share Posted December 12, 2021 16 hours ago, addisonpann said: You've done it again. Thanks a bunch, @bangank36. How do you know which selectors to use? Are you just doing right click > inspect? Basically, I inspect via dev tool of browser BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! 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