Is it possible to reorder columns between desktop and mobile in Bootstrap 5 like the example shown in this image?
https://i.sstatic.net/I74PF.jpg
I have explored using the order
classes and experimented with position: absolute
, but I haven't been able to achieve the desired result.
I came across someone attempting a similar task with an older version of Bootstrap and without a satisfactory solution (I prefer not to use float
). Also, please note that the green plus red parts may have a greater height than the blue part.
Below is the simple code snippet without any column reordering:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d5b7babaa1a6a1a7b4a595e0fbe4fbe6">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="row">
<div class="col-12 col-xxl-6">
<div style="height:20px; background-color:green;"></div>
</div>
<div class="col-12 col-xxl-6">
<div style="height:60px; background-color:blue;"></div>
</div>
<div class="col-12 col-xxl-6">
<div style="height:40px; background-color:red;"></div>
</div>
</div>