peterw Posted June 26 Share Posted June 26 (edited) Hi peeps, long-time reader, first first-time poster here, I have a long-form content page with the header navigation comprised of "page jump" anchor links. The client is a bit old school and would like ALL the links in the nav to be underlined - all of the time. I've tried using some simple CCS rules, but they didn't work. Since I'm a total rookie at CSS, I'm guessing I'm probably missing something basic. Any help would be VERY appreciated, especially since this is the last thing on my punch list for handing the site off to the client. Here's the CSS I tried without success: .nav-menu a { text-decoration: underline; } AND .nav-menu a { border-bottom: 2px solid; } Thanks! Edited June 26 by peterw Link to comment
peterw Posted June 26 Author Share Posted June 26 Solved by Chat GTP! Settings" >>> "Advanced" >>> "Code Injection." In the "Footer" section, paste the JavaScript code wrapped inside the <script> tags. Save your changes and close the Code Injection panel. Preview or publish your site to see the underlined links in the site navigation menu. <script> document.addEventListener('DOMContentLoaded', function() { var navLinks = document.querySelectorAll('.header-nav-item a'); for (var i = 0; i < navLinks.length; i++) { navLinks[i].style.textDecoration = 'underline'; } }); </script> tuanphan 1 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