Currently, I am setting up a grid for a blog where I have cropped the images using object-fill: cover; to ensure uniformity in appearance regardless of the image aspect ratio. However, this approach is causing an issue by stretching the parent element (a div) and pushing the title below the photo.
Below is a simplified version of the code snippet:
<div class="parent">
<img src="#" class="child" style="max-height: 190px; object-fit: cover;">
<h2>Title</h2>
</div>
Is there a solution to address this while still utilizing object-fit or should I consider an alternative method?
Thank you for your assistance.
Edit: Here is a snapshot depicting the current issue. View the problem here