Jump to content

Stretchy Navigation Line - SS 7.0

Go to solution Solved by tuanphan,

Recommended Posts

  • Solution

Use this code

/* 70 stretch nav underline hover */
nav .nav-item a:after {
    content: "";
    position: absolute;
    height: 1px;
    width: 0;
    z-index: 9999;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    transition: all 0.3s;
}
nav .nav-item a {
    position: relative;
}
nav .nav-item a:hover:after {
    width: 100%;
    transition: all 0.3s;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 9 months later...
On 7/22/2022 at 11:02 AM, tuanphan said:

Use this code

/* 70 stretch nav underline hover */
nav .nav-item a:after {
    content: "";
    position: absolute;
    height: 1px;
    width: 0;
    z-index: 9999;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    transition: all 0.3s;
}
nav .nav-item a {
    position: relative;
}
nav .nav-item a:hover:after {
    width: 100%;
    transition: all 0.3s;
}

 

Hi again,

Do you know how to make the color of the underline follow the color theme of the menu ? 

All the best

Edited by diaph
Link to comment
  • 10 months later...

Hi Ninahans:

This is for 7.0 - change the hex color #000000 below to the color you want.

 

// Stretchy Navigation Line //

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

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

 

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.