Answers for "hover menu underline animation"

CSS
3

underline css animation hover

.hover-underline-animation {
  display: inline-block;
  position: relative;
  color: #0087ca;
}

.hover-underline-animation:after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #0087ca;
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.hover-underline-animation:hover:after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
Posted by: Guest on June-23-2021
0

CSS menu list with underline hover animation

.nav-links ul li a{
    /* update color of link text to white, size to 13px and
     delete underline of link-text*/
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}
.nav-links ul li::after{
    /* underline red as a after content it equal a div
    with background color,..*/
    content: '';
    width: 0;
    height: 2px;
    background: #f44336;
    display: block;
    margin: auto;
    transition: 0.5s;
}
.nav-links ul li:hover::after{
    /* ul li ::after when hover */
    width:100%;
}
Posted by: Guest on September-06-2021

Browse Popular Code Answers by Language