I have created a blog page using bootstrap 4 that features both left and right sidebars along with the main content section.
Everything looks great on Desktop view.
However, when viewed on a mobile phone, the order changes to:
left-sidebar>content>right-sidebar
.
My desired layout for mobile phones is:
content>left-sidebar>right-sidebar
https://i.sstatic.net/sXxpU.png
https://i.sstatic.net/s9ZZU.png
To better illustrate this issue, I have prepared a demonstration below:
body {
padding: 40px;
}
.left-sidebar, .content, .right-sidebar {
min-height: 300px; margin-bottom: 40px;border: 1px solid #aaa;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" rel="stylesheet"/>
<main>
<div class="container text-center">
<div class="row">
<div class="col-md-2">
<div class="left-sidebar p-4">Left Sidebar</div>
</div>
<div class="col-md-7">
<div class="content p-4">Content</div>
</div>
<div class="col-md-3">
<div class="right-sidebar p-4">Right Sidebar</div>
</div>
</div>
</div>
</main>