Jump to content

Hide custom hover state for social icons in footer

Recommended Posts

Site URL: https://onh.community

Hello! I'm using this custom CSS to create a hover state for the links in my header and mobile menu, but the hover state is now also showing up for the social links in my footer which I'd like to remove.

Any suggestions for how to do so? Thanks!

 

//LINK HOVER STATE
nav a:hover {
    background-size: 100% 1.5px !important;
}

nav a {
  padding-bottom: 6px;
  overflow: visible !important;
background-repeat: no-repeat !important;
    background-image: linear-gradient(to right,currentColor 100%,currentColor 0) !important;
    background-size: 0% 0.5px !important;
    background-position: 0% 100% !important;
    white-space: initial;
transition: all ease-in-out 500ms !important;
-ms-transition: all ease-in-out 500ms !important;
-moz-transition: all ease-in-out 500ms !important;
-webkit-transition: all ease-in-out 500ms !important;
}

.header-menu-nav-item a {
    display: inline-block;
}

//End navigation underscore//

Screenshot 2022-02-05 at 22.58.34.png

Link to comment

The issue is because the nav elements you are targeting are used in the header and in the footer for the social icons.

Replace (make a copy somewhere) your code with the following.

.header-nav-wrapper a, /* desktop */
.header-menu-nav-item a /* mobile */

  {

    background-image : linear-gradient( to right, currentColor 100%, currentColor 0 );
    background-position : 0% 100%;
    background-repeat : no-repeat;
    background-size : 0% .5px;
    overflow : visible;
    padding-bottom : 6px;

    -ms-transition : all ease-in-out 500ms;
    -moz-transition : all ease-in-out 500ms;
    -webkit-transition : all ease-in-out 500ms;
    transition : all ease-in-out 500ms;
  
    white-space : initial;
    
  }

.header-nav-wrapper a:hover, /* desktop */
.header-menu-nav-item a:hover /* mobile */

  {
  
    background-size : 100% 1px;
    
    }

.header-menu-nav-item a /* mobile */

  {
  
    display : inline-block;
    
    }

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

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.