Having trouble fitting an image into a column of a row created using Bootstrap. I want the image to be the same height as the row and any part that doesn't fit the width to be cropped out. However, the image either takes up only the width of the column leaving the space below empty or becomes larger than the entire table.
I have tried setting the height to 100% and using object-fit:cover but nothing seems to work.
The issue specifically lies with the first column (ignore the other columns).
.hotel-box {
border: 1px solid gray;
border-radius: 16px;
width: 40%;
margin: 50px 0;
}
.hotel-box img {
height: 100%;
object-fit: cover;
}
<!-- Bootstrap-5 -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="91f3fefee5e2e5e3f0e1d1a4bfa2bfa2">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<!-- Body -->
<div class="hotel-box">
<div class="row">
<div class="col-4">
<img src="https://cf.bstatic.com/xdata/images/hotel/max1024x768/279134335.jpg?k=341488f6f4dc7bc8d6232b06730e304ed655bd4a944b1a90eb2ab81ac92a0568&o=&hp=1" alt="">
</div>
<div class="col-5">
<h3>Hotel name</h3>
<p>some info</p>
<p>room info</p>
<p>extra info</p>
</div>
<div class="col-3">
<h4>word rating</h4>
<p>number reviews</p>
<span>number rating</span>
<span>BGN price</span>
<p>per night per person(под числото с дребен шрифт)</p>
</div>
</div>
</div>