While searching for a solution to create a fixed width sidebar on Bootstrap 4, I have come across many examples. However, none of them seem to maintain the main content on mobile devices.
I have experimented with the following code:
<div class="row no-gutters flex-nowrap">
<div class="col-md col-12 d-none d-xs-block d-sm-block ">
Main area
</div>
<div class="col-md-4 col-12 sidebar">
Sidebar
</div>
</div>
.sidebar {
max-width: 600px; min-width: 600px
}
Although this code partially serves the purpose, it causes the sidebar to disappear completely between 768 to 576 pixels.
My goal is to have a fixed width sidebar with the main area resizing and eventually disappearing as the screen size decreases.