Our website layout is organized into 3 main sections: the top part contains the main menu, followed by the main content and a sidebar specific to each page.
The main content and sidebar are structured using bootstrap col-* classes.
On small screens, I encountered an issue where the sidebar was appearing below the main content instead of above it. I attempted to use d-flex
, row-reverse
, and col-reverse
classes to no avail.
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e3818c8c979097918293a3d6cdd3cdd1">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<main role="main">
<div class="container">
<div class="row d-flex">
<div class="col-sm-12 col-md-8">
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
this is the main content. this is the main content.this is the main content. <br />
</div>
<div class="col-sm-12 col-md-4">
<h3>Sidebar</h3>
<ul class="list-group">
<li class="list-group-item"><a href="#">Sidebar Link 1</a></li>
<li class="list-group-item"><a href="#">Sidebar Link 2</a></li>
<li class="list-group-item"><a href="#">Sidebar Link 3</a></li>
<li class="list-group-item"><a href="#">Sidebar Link 4</a></li>
<li class="list-group-item"><a href="#">Sidebar Link 5</a></li>
</ul>
</div>
</div>
</div>
</main>