Utilizing Bootstrap 4, I have constructed a row with 3 columns, each set to a size of 4 on medium and larger displays. Although the content within these cards may vary in size, my goal is to ensure that each card maintains an equal length.
I have opted against using card groups/decks due to their lack of responsiveness; instead, I want the cards to occupy all 12 rows on small/xs displays.
Below is an excerpt of code pertaining to the cards. For a live preview, the project can be accessed on Plunker: http://plnkr.co/edit/RLQaA6knYi69qc4vLr6j?p=info. Upon viewing the project on a large display, it becomes apparent that the cards do not possess equivalent sizes.
According to Bootstrap 4, if no width specifications are provided, cards are expected to stretch to fill the entire width of their container. So, is it safe to assume that they should encompass the full width of the parent container (in this case, the div of col-md-4)?
If my assumption proves incorrect, how can I effectively expand the 3 cards horizontally to cover the entire width of the enclosing column while also ensuring uniform vertical length? Attempts to incorporate flex-column flex-grow
yielded horizontal expansion without affecting vertical sizing. What would be the optimal approach to address this issue?
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<main>
<div id="content-container" class="container">
<div class="row">
<div class="col-12">
<h2 class="display-5 text-center text-white text-uppercase">Portfolio</h2>
</div>
</div>
<div class="row">
<div class="col-md-4 d-flex align-items-stretch">
<div class="card resize-card">
<img class="card-img-top" src=".../100px200/" alt="Card image cap">
<div class="card-footer">Featured</div>
</div>
</div>
<div class="col-md-4 d-flex align-items-stretch">
<div class="card resize-card">
<img class="card-img-top" src=".../100px200/" alt="Card image cap">
<div class="card-footer">Footer</div>
</div>
</div>
<div class="col-md-4 d-flex align-items-stretch">
<div class="card resize-card">
<img class="card-img-top" src=".../100px200/" alt="Card image cap">
<div class="card-body">
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
Edit:
To achieve uniformity in card dimensions, I successfully implemented a class for each card
div with a width value of 100%. Despite this resolution, I'm uncertain if this method adheres to the correct practice, as I initially anticipated cards to automatically adjust in this manner.