bhavanaidnani Posted January 10, 2022 Posted January 10, 2022 Its a single page website. Here I wish to change the color of the active section on the navigation. I have added the following code but this only seems to work on force state over the link. .header-nav-item a:active { color: #fc9e4f !important; } Tired this one as well body:not(.header--menu-open) .header-nav-wrapper a:active { color: #fc9e4f !important; } Let me know if anyone knows other ways to make this happen. Thanks team
Beyondspace Posted January 10, 2022 Posted January 10, 2022 57 minutes ago, bhavanaidnani said: Its a single page website. Here I wish to change the color of the active section on the navigation. I have added the following code but this only seems to work on force state over the link. .header-nav-item a:active { color: #fc9e4f !important; } Tired this one as well body:not(.header--menu-open) .header-nav-wrapper a:active { color: #fc9e4f !important; } Let me know if anyone knows other ways to make this happen. Thanks team Can you share your site with the protected password so we can take a look? 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
bhavanaidnani Posted January 10, 2022 Author Posted January 10, 2022 37 minutes ago, bangank36 said: Can you share your site with the protected password so we can take a look? https://mustard-magenta-z7b6.squarespace.com/ password: firstlook
tuanphan Posted January 12, 2022 Posted January 12, 2022 @bhavanaidnani Add to Settings > Advanced > code Injection > Footer <script> var btnContainer = document.getElementById("header"); var btns = btnContainer.getElementsByTagName("a"); for (var i = 0; i < btns.length; i++) { btns[i].addEventListener("click", function() { var current = document.getElementsByClassName("active"); if (current.length > 0) { current[0].className = current[0].className.replace(" active", ""); } this.className += " active"; }); } </script> <style> .header-nav-item a.active { color: red !important; } </style> 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
Create an account or sign in to comment
You need to be a member in order to leave a comment