johnbuedel Posted May 25, 2022 Share Posted May 25, 2022 Site URL: https://yellow-pufferfish-93g7.squarespace.com/ I'm trying to add an animation hover to the list of links in my archive block. I just want the underline to go from right to left when the user hovers over a list item. I've tried some different code, but I can seem to figure out the class to put the code on. .archive-item-list { text-decoration: none; position: relative; } .archive-item-list a:after { content: ""; height: 2px; width: 0; position: absolute; background-color: black; left: 0; bottom: 0; transition: all 0.7s; } .archive-item-list a:hover:after { transition: all 0.2s; width: 100%; } Link to comment
tuanphan Posted May 26, 2022 Share Posted May 26, 2022 Your site is private. Can you setup password & share url again? 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!) Link to comment
johnbuedel Posted May 26, 2022 Author Share Posted May 26, 2022 (edited) Sure! Password is: NewSite2022! Thank you! Edited May 26, 2022 by johnbuedel Link to comment
johnbuedel Posted May 27, 2022 Author Share Posted May 27, 2022 (edited) Hey, all. I figured it out. Here's the code if you need it. Also, I added some JS to put the blog posts in alphabetical. If you'd like me to drop that in here, let me know. .archive-item { display: flex; width: auto; } .archive-item-link:after { display: flex; content: ''; width: 0px; height: 3px; transition: width .5s ease; } .archive-item-link:hover:after { width: 100%; background: black; } Edited May 27, 2022 by johnbuedel tuanphan and djshiflet 2 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