Skip to content

Instantly share code, notes, and snippets.

@neilgee
Created September 18, 2024 06:41
Show Gist options
  • Save neilgee/7e343aa905c01955d0392d22582a235a to your computer and use it in GitHub Desktop.
Save neilgee/7e343aa905c01955d0392d22582a235a to your computer and use it in GitHub Desktop.
Menu with expanding underline under Menu Items
/* Underlines not on mobile - Change Menu name and background color to suit
*
@media(min-width:768px) {
#menu-primary-menu>li>a::after {
content: '';
position: absolute;
background-color: #00778F;
height: 2px;
bottom: 2px;
width: 30%;
left: 35%;
transform: scaleX(0);
transition: 250ms ease-in-out;
}
#menu-primary-menu>li>a:hover:after {
transform: scaleX(1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment