Currently, I am in the process of designing an HTML template for a news article layout using Bootstrap 4 and working on the MEAN stack environment. However, these specifics shouldn't impact the overall design...
The primary requirement is to have one 'featured' article displayed in its own column, along with 8 other articles split into two rows within another column. When the layout is viewed on smaller screens or mobile devices, the additional articles should stack beneath the featured article and each other as needed:
Desktop View:
-----------------------------------------------------------------
| Article 1 | Article 2 | Article 3 | Article 4 |
Article 0 | |
| Article 5 | Article 6 | Article 7 | Article 8 |
-----------------------------------------------------------------
Mobile View:
-----------------
Article 0
-----------------
Article 1
-----------------
Article 2
-----------------
.
.
To implement this layout, I am currently using the following code:
<div>
<div class="row">
<div class="col-4">
<div>
Article 0
</div>
</div>
<div class="col-8">
<div class="row">
<div class="col-3">
Article 1
</div>
<div class="col-3">
Article 2
</div>
<div class="col-3">
Article 3
</div>
<div class="col-3">
Article 4
</div>
<div class="col-3">
Article 5
</div>
<div class="col-3">
Article 6
</div>
<div class="col-3">
Article 7
</div>
<div class="col-3">
Article 8
</div>
</div>
</div>
</div>
</div>
While this layout works perfectly on desktop view, it causes all elements to display jammed together on a single row when viewed on mobile. Ideally, I would like them to stack into a single column on smaller screens. My suspicion is that the outer <div class="row"
is responsible for this behavior on mobile, but removing it interrupts the placement of Article 0 alongside the others on desktop. It seems like there may be a better way to accomplish this layout without compromising the responsiveness.
Could someone provide guidance on how to adapt this desktop-friendly layout for optimal rendering on mobile? Thank you in advance!