Jump to content

Underline links on navigation menu when clicked

Recommended Posts

  • Replies 8
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Add this code to Website > Website Tools (under Not Linked) > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(function() {
  var loc = window.location.href; // returns the full URL
  if(/new-in/.test(loc)) {
    $('body').addClass('new-in');
  }
      var loc = window.location.href; // returns the full URL
  if(/prints/.test(loc)) {
    $('body').addClass('prints');
  }
});
</script>
<style>
  body.new-in header#header [href*="/new-in"], body.new-in header#header [href*="/prints"] {
    background-image: linear-gradient(currentColor,currentColor);
    background-repeat: repeat-x;
    background-size: 1px 1px;
    background-position: 0 100% !important;
    background-position: 0 calc(100% - 0.1em);
}
  body.new-in header#header [href="/shop"] {
    background-image: none !important;
}
</style>

This code for New In, if it works, I will send code for other

Edited by tuanphan
update prints

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!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.