Jump to content

Custom Active Nav Link

Recommended Posts

Site URL: https://sawfish-tulip-pxkb.squarespace.com/

I would like to replace the active tab underline with an image I have uploaded to my Custom CSS files. I only want it to appear when on the page and not when you hover over the links.

I've currently put in this code but can't seem to get the sizing correctly to adjust to each link and display the image at 100%. 

// active nav links
.header-nav-item:hover a,
.header-nav-item--active a {
  display: inline-block;
  position: relative;
  background-image: none !important;
}
.header-nav-item:hover a:after,
.header-nav-item--active a:after {
    content: '';
    position: absolute;
    width: 150%;
    height: 20px;
    left: 10%;
    bottom: -20px;
    background: url('https://static1.squarespace.com/static/611c2078e04ba63b7ce92922/t/611c461d505a25511e4aca07/1629242909476/Active+Link%402x.png');
    background-size: contain;
    background-repeat: no-repeat;
}

 

Anyone able to help?

434855237_ActiveLink@2x.png.eb9d2405690f1815f5d6444b2ee4eed8.png

Link to comment
  • Replies 2
  • Views 516
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.