Jump to content

Customize CSS for hover to underline

Recommended Posts

Posted

Can someone help me update my CSS so that when I hover over the menu navigation panel on my mobile, the underline is only under the words, and not the entire screen?

This is my current code, and this is what it looks like: 

.header-menu-nav-item { position: relative; }
.header-menu-nav-item::before { content: ""; position: absolute; display: inline-block; width: 100%; height: 3px; bottom: 0; left: 0; background-color: red; transform: scaleX(0); transition: transform 0.3s ease; }
.header-menu-nav-item:not(.header-menu-nav-item--active):hover::before { transform: scaleX(1); }

image.png.eeea042329ebbad3842ea926c030e3bb.png

  • Replies 1
  • Views 866
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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.