2021年4月10日星期六

Dynamically resize bootstrap cards title to align image

As you can see, the title of the second card pushes the image down. How can i dynamically resize the card title in order to align all the image? Thank you.

enter image description here Bootstrap Card

</head>  <body>      <div class="container-fluid">  <div class="row row-cols-1 row-cols-sm-2 row-cols-md-4">    <div class="col">      <div class="card bg-primary">          <div class="card-body text-center">          <h4 class="card-title">John Doe</h4>          <img class="card-img-top" src="https://www.w3schools.com/bootstrap4/img_avatar1.png" alt="Card image">                  <p class="card-text">Some text inside the first card</p>        </div>      </div>    </div>        <div class="col">      <div class="card bg-primary">        <div class="card-body text-center">          <h4 class="card-title">John Doe & other possible long text that push the image down  </h4>          <img class="card-img-top" src="https://www.w3schools.com/bootstrap4/img_avatar1.png" alt="Card image">                  <p class="card-text">Some text inside the second card</p>        </div>      </div>    </div>        <div class="col">      <div class="card bg-primary">        <div class="card-body text-center">          <h4 class="card-title">John Doe </h4>          <img class="card-img-top" src="https://www.w3schools.com/bootstrap4/img_avatar1.png" alt="Card image">                  <p class="card-text">Some text inside the third card</p>        </div>      </div>    </div>         </div>  </div>    </body>  </html>  

JsFiddle code

https://stackoverflow.com/questions/67040856/dynamically-resize-bootstrap-cards-title-to-align-image April 11, 2021 at 10:10AM

没有评论:

发表评论