bhavanaidnani Posted January 10, 2022 Share 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 Link to comment
Beyondspace Posted January 10, 2022 Share 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? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
bhavanaidnani Posted January 10, 2022 Author Share 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 Link to comment
tuanphan Posted January 12, 2022 Share 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 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