-1

How can I make bootstrap cards the same height? I know there is the h-100 i can use but in my case, this is to large- I would need something like h-50 but this doesn't work. I also tried h-25 which is also not working.

Is there another trick on how to make cards the same height?

redbulll
  • 91
  • 4
  • 10

1 Answers1

0

This is working example of exact height cards Check it out and let me know if it helped you

<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>

</head>
<body>
  <div class="container">
    <div class="row mt-5">
        <div class="col-3">
          <div class="card h-100">
            <img src="https://via.placeholder.com/300" class="img-fluid">
            <p> This is card 1</p>
            <p>With more text and description</p>
            <p>blah blah blah</p>
          </div>
        </div>
        <div class="col-3">
          <div class="card h-100">
            <img src="https://via.placeholder.com/300" class="img-fluid">
            <p>This is card 2</p>
            <p>with less text</p>
          </div>
        </div>

        <div class="col-3">
          <div class="card h-100">
            <img src="https://via.placeholder.com/300" class="img-fluid">
            <p>This is card 3</p>
          </div>
        </div>

        <div class="col-3">
          <div class="card h-100">
            <img src="https://via.placeholder.com/300" class="img-fluid">
            <p>All with equal heights</p>
          </div>
        </div>
    </div>
  </div>
</body>
</html>
Khalid Khan
  • 3,017
  • 1
  • 11
  • 27
  • I know that it works with h-100 but h-100 is to large- i know i also can use h-75 h-50 and h-25 but for some reason its not working – redbulll Apr 28 '20 at 06:26
  • @redbulll bro if you gonna use with row then only it will work :) – Khalid Khan Apr 28 '20 at 06:27
  • the thing is tht i use a carousell- you can check out my site here: oval-babies.surge.sh- the carousell on top is for advertising and i want it half the size as what it is now – redbulll Apr 28 '20 at 07:28