Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I customize the default spacing between Bootstrap cards?
Asked on Jan 25, 2026
Answer
To customize the default spacing between Bootstrap cards, you can use Bootstrap's spacing utility classes or apply custom CSS. Here's a simple example using Bootstrap's margin utility classes to adjust the spacing.
<!-- BEGIN COPY / PASTE -->
<div class="container">
<div class="row">
<div class="col-md-4 mb-4"> <!-- Adjust spacing with mb-4 -->
<div class="card">
<div class="card-body">
Card 1
</div>
</div>
</div>
<div class="col-md-4 mb-4"> <!-- Adjust spacing with mb-4 -->
<div class="card">
<div class="card-body">
Card 2
</div>
</div>
</div>
<div class="col-md-4 mb-4"> <!-- Adjust spacing with mb-4 -->
<div class="card">
<div class="card-body">
Card 3
</div>
</div>
</div>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- You can adjust the margin by changing the `mb-4` class to any other margin-bottom class like `mb-2`, `mb-3`, etc., based on your spacing needs.
- The `mb-4` class applies a margin-bottom of 1.5rem to each card, creating space between them.
- If you need more control, consider using custom CSS to set specific margins.
Recommended Links:
