To achieve a wrapped flexbox layout for the .card-body
, you can simply set its justify-content
to flex-start
, which is actually the default setting. Additionally, Bootstrap offers some helpful built-in classes that you can utilize.
<div class="card">
<div class="card-body d-flex flex-row">
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
<img src="https://via.placeholder.com/150" />
</div>
</div>
https://i.sstatic.net/oKpoF.png
Check out this demo: https://jsfiddle.net/davidliang2008/cb9n652j/8/