I need to develop a versatile element with bootstrap that can accommodate images of different aspect ratios. To achieve this, I must trim the right side of the picture like so.
<div class="container">
<div class="row">
<div class="col-12">
<div class="card shadow h-100">
<div class="card-body-article">
<div class="row no-gutters">
<div class="col-3 d-flex align-content-center">
<div class="article-img-crop">
<img class="article-img" src="https://images.amcnetworks.com/blogs.amctv.com/wp-content/uploads/2013/01/bb-s5-skinny-pete-interview-560.jpg">
</div>
</div>
<div class="col-9">
<div class="row no-gutters">
<div class="col-6">
<div class="card-title">Test</div>
</div>
<div class="col-6">
<div class="text-muted text-right">03/05/2020 12:52pm</div>
</div>
</div>
<div class="row no-gutters">
<div class="text-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras gravida lectus eu elit maximus rhoncus. Vivamus vitae enim in felis consequat efficitur a quis dui. Aenean id tristique dui, in finibus dui. Etiam ut nunc lobortis, tempor odio ut, ornare metus. Donec convallis tincidunt velit. Nullam ipsum est, condimentum quis nunc quis, sollicitudin condimentum orci. Nunc vehicula porttitor porttitor. Duis et augue vestibulum, iaculis eros vitae, lacinia urna.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
.article-img-crop {
position: relative;
overflow: hidden;
border-top-left-radius: 0.35rem;
border-bottom-left-radius: 0.35rem;
}
https://jsfiddle.net/ce3mxnLp/
The challenge lies in the fact that the current form of the element adopts the height of the source image. My goal is for the element's height to be determined by the text quantity, while the image should scale proportionally and crop off a variable portion on the right side. Is this feasible given the flexbox nature of bootstrap columns? It appears I am unable to utilize the column height to control another element's properties.
I would greatly appreciate any assistance. Thank you.