Jump to content

Underline hover animation navigation bar

Recommended Posts

Site URL: https://www.lucienandsolenn.com/

Hello there! 

I know that there is some post about this, and I found a good code for it . However, I cannot find a way to "stop the line" under the drop down menu links and make it 100% of the word, not beyond. How can I do? I post the picture of it below. Thank you in advance!

My website password : Forthesakeoflove

Here is the css code

.header-nav-item > a:after, .header-nav-folder-item > a:after {
  content:'';
  width: 0px;
  height: 1px;
  background: #fff;
  display: block;
  transition: width .2s ease;
}

.header-nav-item > a, .header-nav-folder-item:hover {
  background: none !important;
}

.header-nav-item--active > a:after, .header-nav-item:hover > a:after, .header-nav-folder-item:hover > a:after {
  width: 100%;
}

.header-nav-folder-item:hover > a {
  color: #fff !important;
} 

Screenshot 2022-09-20 at 11.53.51.png

Link to comment
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

3 hours ago, Soona said:

Site URL: https://www.lucienandsolenn.com/

Hello there! 

I know that there is some post about this, and I found a good code for it . However, I cannot find a way to "stop the line" under the drop down menu links and make it 100% of the word, not beyond. How can I do? I post the picture of it below. Thank you in advance!

My website password : Forthesakeoflove

Here is the css code

.header-nav-item > a:after, .header-nav-folder-item > a:after {
  content:'';
  width: 0px;
  height: 1px;
  background: #fff;
  display: block;
  transition: width .2s ease;
}

.header-nav-item > a, .header-nav-folder-item:hover {
  background: none !important;
}

.header-nav-item--active > a:after, .header-nav-item:hover > a:after, .header-nav-folder-item:hover > a:after {
  width: 100%;
}

.header-nav-folder-item:hover > a {
  color: #fff !important;
} 

Screenshot 2022-09-20 at 11.53.51.png

Do you mean something like this?

image.thumb.png.926b65ba4d341d058cd975554ee3d89e.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

I try the following code and it seems fine

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

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

Edited by bangank36

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

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.