jeremy-h of Web Development
11/9/2017 - 5:21 PM

Link Underline Animation

Styled to work in a Bootstrap Nav menu, but can be applied to any link.

.navbar-nav>li>a {
    display: inline-block;
    position: relative;
}
.navbar-nav>li>a:after {
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    left: 50%;
    position: absolute;
    background: #fff;
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0;
}
.navbar-nav>li>a:hover:after {
    width: 100%;
    left: 0;
}