Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Reducing space between navigation and underline


Elise__

Question

Site URL: https://mandarin-violin-mjw7.squarespace.com

password: elise

Dear squarespace community, 

I have animated underline for my navigation links. However the space between the underline and the link is quite big. How do I reduce the space so that the underline is directly below the navigation link? 

This is the code I use:

 /* navigation underline animation */
.header-nav-item::after {
  content: '';
  background: #FFFFFF; //color
  height: 2px; //thickness
  width: 0;
  display: block;
  margin-top: 1px !important;
  transition: width 0.5s; //animation speed
  margin: 0 auto;
}

.header-nav-item:hover::after {
  width: 100%;
}

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

 

Link to comment
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 1
22 hours ago, Elise__ said:

Site URL: https://mandarin-violin-mjw7.squarespace.com

password: elise

Dear squarespace community, 

I have animated underline for my navigation links. However the space between the underline and the link is quite big. How do I reduce the space so that the underline is directly below the navigation link? 

This is the code I use:

 /* navigation underline animation */
.header-nav-item::after {
  content: '';
  background: #FFFFFF; //color
  height: 2px; //thickness
  width: 0;
  display: block;
  margin-top: 1px !important;
  transition: width 0.5s; //animation speed
  margin: 0 auto;
}

.header-nav-item:hover::after {
  width: 100%;
}

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

 

Add to Design > Custom CSS

.header-nav-item::after {
    top: -10px;
    position: relative;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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