Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I use Bootstrap utility classes to add custom spacing between card components?
Asked on Jan 05, 2026
Answer
Bootstrap provides utility classes to easily add custom spacing between elements, including card components. You can use margin utilities like `mb-3` for bottom margin or `mt-3` for top margin to control the spacing.
<!-- BEGIN COPY / PASTE -->
<div class="card mb-3">
<div class="card-body">
<h5 class="card-title">Card 1</h5>
<p class="card-text">This is the first card.</p>
</div>
</div>
<div class="card mb-3">
<div class="card-body">
<h5 class="card-title">Card 2</h5>
<p class="card-text">This is the second card.</p>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card 3</h5>
<p class="card-text">This is the third card.</p>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Use `mb-3` to add a bottom margin of 1rem (16px) to each card, creating space between them.
- You can adjust the number in `mb-3` to `mb-1`, `mb-2`, etc., for different spacing sizes.
- Similarly, use `mt-3` for top margin, `ml-3` for left margin, and `mr-3` for right margin if needed.
Recommended Links:
