<div class="container">
<ul>
<li><a href="#">Uno Uno Uno</a></li>
<li><a href="#">Dos</a></li>
<li><a href="#">Tres</a></li>
<li><a href="#">Quatro</a></li>
</ul>
<hr />
</div>
* {
box-sizing: border-box;
}
body {
font: 300 100% 'Helvetica Neue', Helvetica, Arial;
}
.container {
width: 50%;
margin: 0 auto;
}
ul {
display: flex;
width: 100%;
justify-content: space-around;
}
ul li {
text-align: center;
list-style: none;
}
a {
display: block;
width: 10%0;
padding: .75rem 0;
margin: 0;
text-decoration: none;
color: #333;
}
hr {
height: .25rem;
margin: 0;
width: 0;
background: tomato;
border: none;
transition: all 250ms;
}
jQuery(document).ready(function($) {
$('ul li').hover(function() {
var left = $(this).offset().left - $('ul').offset().left,
width = $(this).width();
$('hr').css({
'margin-left': left,
'width' : width
})
}).first().mouseenter().mouseleave()
});
This Pen doesn't use any external CSS resources.