Elise__ Posted July 20, 2021 Posted July 20, 2021 Site URL: https://mandarin-violin-mjw7.squarespace.com password: elise Dear squarespace community, I have animated underline for my navigation links. However the space between the underline and the link is quite big. How do I reduce the space so that the underline is directly below the navigation link? This is the code I use: /* navigation underline animation */ .header-nav-item::after { content: ''; background: #FFFFFF; //color height: 2px; //thickness width: 0; display: block; margin-top: 1px !important; transition: width 0.5s; //animation speed margin: 0 auto; } .header-nav-item:hover::after { width: 100%; } .header-nav-item--active a { background-image: none !important; }
tuanphan Posted July 21, 2021 Posted July 21, 2021 22 hours ago, Elise__ said: Site URL: https://mandarin-violin-mjw7.squarespace.com password: elise Dear squarespace community, I have animated underline for my navigation links. However the space between the underline and the link is quite big. How do I reduce the space so that the underline is directly below the navigation link? This is the code I use: /* navigation underline animation */ .header-nav-item::after { content: ''; background: #FFFFFF; //color height: 2px; //thickness width: 0; display: block; margin-top: 1px !important; transition: width 0.5s; //animation speed margin: 0 auto; } .header-nav-item:hover::after { width: 100%; } .header-nav-item--active a { background-image: none !important; } Add to Design > Custom CSS .header-nav-item::after { top: -10px; position: relative; } 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
Archived
This topic is now archived and is closed to further replies.