Jump to content

Need Fix for Shifting Hyperlinks on Hover (in Footer)

Recommended Posts

  • Replies 5
  • Views 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

They are shifting because you've added custom CSS that adds a border to the bottom of the relevant elements. Adding borders with a px of one or more takes space and so the elements shift.

If you want to continue using a border then you need to add a border with transparent color for the non-hover state.

Add the following to Website > Website Tools > Custom CSS.

h1 a,
h2 a,
h3 a,
h4 a,
p a

  {
  
    border-bottom : 1px solid transparent;
    
    }

h1 a:hover,
h2 a:hover,
h3 a:hover,
h4 a:hover,
p a:hover

  {
  
    border-bottom-color : currentColor;
    
    }

You can also use LESS syntax which can save some typing and make maintenance easier.

// uses LESS syntax

h1,
h2,
h3,
h4,
p

  {
  
    a {
    
      border-bottom : 1px solid transparent;
      
      &:hover {
      
        border-bottom-color : currentColor;
        
        }
        
      }
      
    }

Alternately you could use the text-decoration propertly.

h1 a span:hover,
h2 a span:hover,
h3 a span:hover,
h4 a span:hover,
p a span:hover

  {
  
    text-decoration : underline;
    
    }

This is for v7.1.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
Quote

I tried the first batch with solid transparent but still no change.

I do not see the code installed. My local testing.

When the code is installed, we can then take a look at why it might not be working.

Quote

What I don't understand though is why are only the footer links shifting?

It's probably the structure of the HTML is different between the footer and other sections.

 

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.