I currently have my navbar styled like this to make its background "shrinkwrap" to the width of the content, and no wider:
<nav class="navbar fw-bold h5 rounded-5 navbar-expand d-inline-flex">
<div class="container-fluid">
<ul class="navbar-nav">
<li class="nav-item">
<NavLink class="nav-link" :to="{ name: 'Home' }">Home</NavLink>
</li>
[...]
</ul>
</div>
</nav>
The default Bootstrap behaviour is to collapse the navbar at a certain preset pixel width, such as at 992px with .navbar-expand-lg
:
However, I'd like the navbar to only collapse when the viewport stops being wide enough to house it, like when the horizontal scrollbar appears in the following capture:
Can this be done with Bootstrap styling? It seems to only be designed to work with the set of fixed pixel width "breakpoints" rather than breaking at the natural content width.