You are looking for responsive layout: https://getbootstrap.com/docs/4.0/layout/overview/
In your case, this could show this sidebar on certain width (large devices) and hide it on others, like:
<div class='yourLargeNavbar'> ... </div>
<div class='yourSmallNavbar'> ... </div>
And then, with CSS:
// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) {
.yourLargeNavbar{
display:none;
}
.yourSmallNavbar{
display:block;
}
}
@media (min-width: 767.98px) {
.yourLargeNavbar{
display:block;
}
.yourSmallNavbar{
display:none;
}
}
This way, when the screen size is less than 767px, the small navbar will appear and the large one disappear, and viceversa.
There are a lot of examples, and Bootstrap has their own navbar
component that works with a responsive way: https://getbootstrap.com/docs/4.0/components/navbar/
Edit: Check the code now:
<div class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbarsExample07" aria-controls="navbarsExample07" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</div>
You should change the class: nav-toggler
to navbar-toggle
and delete the "bs" in some data-params and change the button to div. Replace the piece of code for the one I posted and it should work.
Here: https://codepen.io/jpaulet/pen/xxEprGB