Jump to content

Button hover effect animation - code might be outdated

Recommended Posts

I currently have the code for a WIX website for my navigation styling, however in Squarespace I would love to use this for navigation and the buttons across the site.

I would like the final look of the buttons to have an underline when static/inactive, but on hover for the underline to have a transition animation to a thicker line or different colour even? Whatever is more accessible for css.

Is there an adjustment to this code that can make this happen?:

/* Change the color, thickness, and width of underline on hover for navigation menu links */
nav a:hover {
text-decoration: none;
position: relative;
}
 
nav a:hover::after {
content: '';
position: absolute;
left: 0;
bottom: -2px; /* Adjust the position as needed */
height: 2px; /* Thickness of the underline */
width: 100%;
background-color: #d9369e; /* Color of the underline */
transform: scaleX(1);
transition: transform 0.3s ease;
transform-origin: left;
}
 
nav a::after {
content: '';
position: absolute;
left: 0;
bottom: -2px; /* Adjust the position as needed */
height: 2px; /* Thickness of the underline */
width: 100%;
background-color: transparent;
transform: scaleX(0);
transition: transform 0.3s ease;
transform-origin: left;
}
 
 

 

 

Link to comment
  • Replies 1
  • Views 96
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.