Is it possible to style a border button in CSS so that the width matches the text above?
I am trying to achieve a clean look for the navigation selected text, where the border-bottom aligns with the text above. Here is an example of what I have attempted so far:
.nav-link {
padding-right: 29px;
padding-left: 29px;
-webkit-transform: translate(0px, 0px);
transform: translate(0px, 0px);
font-family: Lato, sans-serif;
color: rgba(51, 51, 51, 0.53);
line-height: 20px;
font-weight: 300;
cursor: pointer;
}
.nav-link.active {
border-bottom: 1.5px solid #000;
color: #000;
}
<div class="container">
<nav role="navigation" class="menu">
<a href="#" class="nav-link active item">One</a>
<a href="#" class="nav-link item">Two</a>
<a href="#" class="nav-link item">Three</a>
<a href="#" class="nav-link item">Four</a>
<a href="#" class="nav-link item">Five</a>
<a href="#" class="nav-link item">Six</a>
<a href="#" class="nav-link item">Seven</a>
</nav>
</div>