Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize the default spacing between Bootstrap card components?
Asked on Apr 12, 2026
Answer
To customize the default spacing between Bootstrap card components, you can use Bootstrap's spacing utility classes. These classes allow you to adjust margins and paddings easily.
<!-- BEGIN COPY / PASTE -->
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title">Card 1</h5>
<p class="card-text">Some quick example text to build on the card title.</p>
</div>
</div>
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title">Card 2</h5>
<p class="card-text">Some quick example text to build on the card title.</p>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- The `mb-4` class adds a bottom margin of 1.5rem to each card, creating space between them.
- You can adjust the number in `mb-4` to `mb-0`, `mb-1`, `mb-2`, etc., to change the spacing.
- Use `mt-*`, `ml-*`, `mr-*`, and `mx-*` for top, left, right, and horizontal margins, respectively.
Recommended Links:
