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 May 09, 2026
Answer
To customize the default spacing between Bootstrap card components, you can use Bootstrap's utility classes for margin and padding. These classes allow you to adjust the spacing easily without writing additional CSS.
<!-- BEGIN COPY / PASTE -->
<div class="card mb-3">
<div class="card-body">
<h5 class="card-title">Card 1</h5>
<p class="card-text">Some quick example text.</p>
</div>
</div>
<div class="card mb-5">
<div class="card-body">
<h5 class="card-title">Card 2</h5>
<p class="card-text">Some more example text.</p>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- The `mb-3` class adds a margin-bottom of 1rem to the first card.
- The `mb-5` class adds a margin-bottom of 3rem to the second card.
- You can adjust the spacing by changing the number in the `mb-*` class (e.g., `mb-1`, `mb-2`, etc.).
- These utility classes are part of Bootstrap's spacing utilities, which range from 0 to 5.
Recommended Links:
