Just diving into Bootstrap and attempting to incorporate images as cards, I encountered a challenge where the cards were piling up one after another without any spaces between them. Below is the code snippet utilizing Bootstrap4:
<body>
<div class="container-fluid">
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 card">
<a href="#" class="">
Beautiful
<img class="img-fluid " src="https://upload.wikimedia.org/wikipedia/en/2/25/Bazzi_-_Beautiful.jpeg" alt="" srcset="">
</a>
</div>
(Other card elements go here)
</div>
</div>
Upon implementing this code, the cards are displayed in a stacked manner without any spacing in between.
https://i.sstatic.net/HCaSq.png
I experimented with adding mr-1
, but it caused the fourth card to wrap onto a new row.
https://i.sstatic.net/Ce1H1.png
Is there a way to insert equal spaces between the cards, both above and below them?