In my Bootstrap 5 setup, I have a layout with columns structured like this:
<div class="row">
<div class="col-md-3 mb-3 border rounded">
<p>Column 1</p>
</div>
<div class="col-md-3 mb-3 border rounded">
<p>Column 2</p>
</div>
<div class="col-md-3 mb-3 border rounded">
<p>Column 3</p>
</div>
<div class="col-md-3 mb-3 border rounded">
<p>Column 4</p>
</div>
</div>
Upon adding borders to the columns, I noticed there was no spacing between them. To rectify this, I added class="row gap-3"
to the top-level <div>
.
This adjustment indeed created space between the columns, but it also caused the fourth column to wrap onto the next row.
Is there a way to maintain the four columns in one row while still having space between each of them?