vincentlefre Posted August 1, 2022 Posted August 1, 2022 (edited) Hey all, So I have added an underline to the active nav bar item using the follow code - .Header-nav-item--active { border-bottom: 1.5px solid #a96628; } The result is almost right, however the line overshoots the text slightly. This seems to be because the text has some kind of padding to the right and so the underline extends all the way to there ( see images below). Any ideas how I might eliminate this so that the underline is exactly the same width as the text? (This is using a Brine template in 7.0) Thanks in advance! Edited August 1, 2022 by vincentlefre
Beyondspace Posted August 1, 2022 Posted August 1, 2022 2 hours ago, vincentlefre said: Hey all, So I have added an underline to the active nav bar item using the follow code - .Header-nav-item--active { border-bottom: 1.5px solid #a96628; } The result is almost right, however the line overshoots the text slightly. This seems to be because the text has some kind of padding to the right and so the underline extends all the way to there ( see images below). Any ideas how I might eliminate this so that the underline is exactly the same width as the text? (This is using a Brine template in 7.0) Thanks in advance! Can you share your site with the protected password so we can take a look at it? 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
vincentlefre Posted August 1, 2022 Author Posted August 1, 2022 Sure - https://adrisenergy.squarespace.com/ Password - 1234
tuanphan Posted August 4, 2022 Posted August 4, 2022 On 8/1/2022 at 10:00 PM, vincentlefre said: Sure - https://adrisenergy.squarespace.com/ Password - 1234 You can use this new code to add underline on active items a.Header-nav-item.Header-nav-item--active:after { content: ""; background-color: #a96628; position: absolute; left: 0; width: 90%; bottom: 0; height: 1.5px; } a.Header-nav-item.Header-nav-item--active { 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!)
vincentlefre Posted August 4, 2022 Author Posted August 4, 2022 @tuanphan This works well, thank you very much
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment