Bootstrap 5 cards equal height

Created at 26-Apr-2021 , By samar

Bootstrap 5 cards equal height

In this article, we will see how to solve "Bootstrap 5 cards equal height".

  • Bootstrap 5 cards equal height using d-flex

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm d-flex">
                <div class="card card-body flex-fill">
                    A small card content.
                </div>
            </div>
            <div class="col-sm d-flex">
                <div class="card card-body flex-fill">
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
                    in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
                </div>
            </div>
            <div class="col-sm d-flex">
                <div class="card card-body flex-fill">
                    Another small card content.
                </div>
            </div>
        </div>
    </div>
    

    We have to use the d-flex property to assign equal height to each card in bootstrap. Sometimes we have to create cards with text, images, and links and each card does not have the same amount of content. In that case, we have to create cards with equal height. 

Back to code snippet queries related bootstrap

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.