I've been on a quest to find a method to display a bootstrap column vertically instead of horizontally.
I am adamant about not using masonry or any other external library. My goal is to have "Card 2" appear beneath "Card 1" on medium to small screens. Here is what my code currently looks like:
<div class="container">
<div class="row no-gutters">
<div class="col-lg-6">
<!-- Card 1 -->
<div class="card" style="height: 500px">
<div class="card-header">Card 1</div>
<div class="card-body">
<p class="card-text">Text for this card.</p>
</div>
</div>
</div>
<div class="col-lg-6">
<!-- Card 2 -->
<div class="card" style="height: 430px">
<div class="card-header">Card 2</div>
<div class="card-body">
<p class="card-text">Text for this card.</p>
</div>
</div>
</div>
(remaining cards)
</div>
Here is a preview of how my content currently appears: https://i.sstatic.net/0NhZM.png
I am seeking to eliminate any spaces between the cards (top or bottom).
I attempted placing two col-6
and adding the items normally, which displayed the items in columns:
<div class="container">
<div class="row no-gutters">
<div class="col-lg-6">
<!-- Card 1 -->
<!-- Card 2 -->
<!-- Card 3 -->
<!-- Card 4 -->
</div>
<div class="col-lg-6">
<!-- Card 5 -->
<!-- Card 6 -->
<!-- Card 7 -->
</div>
</div>
</div>
In the above markup, I would like card 5
to appear after card 1
on medium to small screens.
NOTE: I've spent hours scouring Google in search of a simple, direct solution to achieve this without relying on masonry or similar plugins.