I am working on a Bootstrap4 Navigation bar with a brand and some links (nav-item). However, I am facing a challenge with centering a search form inside the nav bar. I want the form to be completely centered within the entire navbar, rather than taking up the remaining space. Are there any specific classes or styles that I need to add to achieve this? Additionally, I would like to add links on the right side where the form is currently located.
I have tried experimenting with margin classes, adding "mx-auto" to the form, placing the form inside the ul list, and using "display: inline-block".
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Brand</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
Currently, the inline form is centered on the right side, but I want it to be perfectly centered in the middle. I have included some photos for reference. (Please note that I am using Bootstrap Material Design, which may cause some differences in appearance)
Current: Current result Desired Outcome: Desired outcome