Behold, my masterpiece navigation bar:
#main-nav-bar .nav-item {
display: inline-block;
padding: 0.5%;
border-right: 1px solid white;
}
#main-nav-bar a {
text-decoration: none;
color: #CFCFE0;
}
<nav id="main-nav-bar">
<a href="#Services" class="nav-tab nav-item selected">Services</a>
<a href="#Resources" class="nav-tab nav-item">Resources</a>
<a href="#Contact-Us" class="nav-tab nav-item">Contact Us</a>
<a href="#Company" class="nav-tab nav-item">Company</a>
<form class="searchbar nav-item" action="http://www.google.com/search" name="f" target="_blank">
<input size="10" name="q" value="" class="searchform">
<input type="submit" value="Go!" name="btnG" class="searchbutton">
<br>
</form>
</nav>
I am on a quest to perfectly center the 5 items inside the nav
element in a responsive manner.
I've attempted to adjust the margin
s, though the centering still eludes me.
How can I achieve flawless centering?