I thought this was going to be easy, but 7 hours later, nope.
I'm trying to position my navbar-brand
to the left, a blurb of text centered (always visible), and my navbar-collapse
to the right.
The problem is the always visible centered text - everything I try forces the text onto a newline.
<div class="navbar navbar-expand-lg justify-content-center">
<div class="container">
<a href="/" class="navbar-brand d-flex w-50 mr-auto">
<h1>
<img src="/img/xxx.svg" width="36" height="36" alt="foobar">
Foobar
</h1>
</a>
<need a container here to center this text>CENTERED BLURB OF TEXT</need>
<button type="button" class="navbar-toggler bg-primary" data-toggle="collapse" data-target="#navbar-collapse">
<span class="valign-image-text">
MENU
<img src="/img/menu-light.svg" width="30" height="30" alt="" class="ml-2">
</span>
</button>
<div class="navbar-collapse collapse w-100" id="navbar-collapse">
<!-- <ul class="navbar-nav w-100 justify-content-center"> -->
<!-- <li>This centered blurb of text collapses, not what I want</li> -->
<!-- </ul> -->
<ul class="navbar-nav w-100 ml-auto justify-content-end">
<li class="nav-item"><a class="nav-link" href="#">Services</a></li>
<li class="nav-item"><a class="nav-link" href="#">Pricing</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>
<li class="nav-item"><a class="btn btn-gray ml-0 ml-lg-4" href="#">Downloads</a></li>
</ul>
</div>
</div>
</div>
Don't post links to other Bootstrap 4 centering helper posts on SO, because they do not cover this.