This is the appearance of the layout in lg
.
For mobile devices, specifically sm
, I am aiming for the column order to be: 1, 3, 5, 2, 6, 4
Is this achievable, and if so, is it relatively straightforward using Bootstrap 4.0 or do I need to rewrite the code?
All my attempts with order-sm
from 1 to 12 have been unsuccessful. No matter what I try, I can't seem to move column 4 to the end as the last column.
Reorganizing to ensure that column 4 is at the end on mobile devices is crucial, even if achieving everything else I mentioned is impossible.
_______________________
| | |
| 1 | 2 |
|_________________| |
| | |_____|
| 3 | 4 | |
| | | 5 |
| | |_____|
| |_____| |
|___________| | 6 |
| |
|_____|
<div class='my-5 px-3 col-sm-12 col-md-12 col-lg-12 float-left'>
<div class='mb-3 col-sm-12 col-md-12 col-lg-9 float-left'>
1
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right'>
2
</div>
<div class='mt-3 mb-3 col-sm-12 col-md-12 col-lg-6 float-left'>
3
</div>
<div class='mt-3 mb-3 col-sm-12 col-md-12 col-lg-3 float-left'>
4
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right'>
5
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right'>
6
</div>
</div>
EDIT: The current code almost achieves the desired structure but there is a gap between columns 1 and 3. Additionally, column 6 is positioned below column 3 instead of below column 5, which is where it should be located.
_______________________
| | |
| 1 | 2 |
|_________________| |
_________________|_____|
| | | |
| 3 | 4 | 5 |
| | |_____|
| |_____|
|___________|
| |
| 6 |
| |
|_____|
<div class='my-5 px-3 col-sm-12 col-md-12 col-lg-12 d-flex flex-row flex-wrap'>
<div class='mb-3 col-sm-12 col-md-12 col-lg-9 float-left order-1 order-sm-1 order-md-1 order-lg-1'>
1
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right order-4 order-sm-4 order-md-4 order-lg-2'>
2
</div>
<div class='mt-3 mb-3 col-sm-12 col-md-12 col-lg-6 float-left order-2 order-sm-2 order-md-2 order-lg-3'>
3
</div>
<div class='mt-3 mb-3 col-sm-12 col-md-12 col-lg-3 float-left order-6 order-sm-6 order-md-6 order-lg-4'>
4
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right order-3 order-sm-3 order-md-3 order-lg-5'>
5
</div>
<div class='mb-3 col-sm-12 col-md-12 col-lg-3 float-right order-5 order-sm-5 order-md-5 order-lg-6'>
6
</div>
</div>