Jump to content

Styling active link

Go to solution Solved by Lesum,

Recommended Posts

https://finnskogutstillingen.squarespace.com/
password: finnskogutstillingen24

I managed to style hover underline thickness and offset, but I also want the active link to have the same style....
What am I doing wrong?

 

.header-nav-item a:hover {
    text-decoration: underline;
  	text-underline-offset: 8px;
	text-decoration-thickness: 3px;
}

.header-nav-item a:after {
    text-decoration: underline;
  	text-underline-offset: 8px;
	text-decoration-thickness: 3px;
}

 

Link to comment

@gullbekken You can add this code snippet to remove the underline on the active link:

.header-nav-item--active a {
	background-image: none !important;
}

Now you can add this code snippet to display the same style on the active link:

.header-nav-item--active a {
	text-decoration: underline !important;
	text-underline-offset: 8px;
	text-decoration-thickness: 3px;
}

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment

@gullbekken It should have worked. Not sure where or how you added the code. I don't see the code being added to your site. Did you add the code under Custom CSS?

Edited by Lesum

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
  • Solution

@gullbekken Your previous code is conflicting with the code I provided.

Referring to the screenshot you shared, could you please add !important after `8px` on line 14 and `3px` on line 15 in the code?

So line 14 and 15 should look like this:

text-underline-offset: 8px !important;
text-decoration-thickness: 3px !important;

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.