Is it possible to achieve a layout similar to this example:
I've come across some online examples using different versions of bootstrap, but they tend to alter the css too much, making it harder to grasp the concepts of bootstrap.
I am curious if it is possible to accomplish this in Bootstrap 4 using features like collapse, stacked pills, and flexbox?
Here is my attempt: https://jsfiddle.net/kL9u6esw/20/
What I couldn't get right in my Jsfiddle :
- Not fully responsive
- The navbar doesn't scroll properly with the sticky class
- The menu button doesn't remain sticky even though the class is set
- A background dimmer, while not essential for the answer, would be a nice addition
In my example, I struggled with inserting a navbar, and I'm unsure if it is necessary for proper responsiveness.
Also, I'm uncertain if using columns is the correct approach, or if it should be done off-canvas.
HTML code :
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-5 col-md-3 collapse m-0 p-0 h-100 bg-dark" id="collapseExample">
<ul class="nav flex-column navbar-dark sticky-top">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
<div class="col">
<div class="row">
<div class="col-12">
<button class="btn sticky-top" data-toggle="collapse" href="#collapseExample" role="button">
Menu
</button>
</div>
<div class="col-12">
Lorem...
</div>
</div>
</div>
</div>
</div>