Elise__ Posted July 20, 2021 Share 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; } Link to comment
Solution tuanphan Posted July 21, 2021 Solution Share 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; } Elise__ 1 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