Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I create a responsive card deck with varying card heights in Bootstrap?
Asked on Mar 14, 2026
Answer
Creating a responsive card deck with varying card heights in Bootstrap is straightforward. You can use the `card` class along with the `row` and `col` classes to ensure responsiveness.
<!-- BEGIN COPY / PASTE -->
<div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col">
<div class="card h-100">
<img src="image1.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title 1</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="image2.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title 2</h5>
<p class="card-text">Another example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<img src="image3.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title 3</h5>
<p class="card-text">Yet another example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- The `row-cols-1 row-cols-md-3` classes ensure that the cards stack vertically on smaller screens and display three cards per row on medium and larger screens.
- The `g-4` class adds a gap between the cards.
- The `h-100` class ensures that all cards have the same height, even if their content varies.
- Replace `image1.jpg`, `image2.jpg`, and `image3.jpg` with the actual paths to your images.
Recommended Links:
