I am facing an issue with my two-column layout. One column contains an image and the other column has text and buttons with a fixed height. To ensure the image is responsive, I have set the width to 100% and height to auto. However, upon resizing, the aspect ratio of the image does not match the height of the second column.
On the other hand, if I set the image height to 100%, it aligns well with the height of the second column but compromises the aspect ratio of the image. Any suggestions on how to tackle this dilemma?
PS
It works fine in mobile view with a max-width of 567px. The problem arises in PC view for which I need assistance.
.btn {
width: 100px;
}
.explain {
height: 250px;
}
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e3e213e3e2b3c60243d0e7f607f78607f">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</head>
<body class="bg-light">
<div class="container-fluid">
<div class="row">
<div class="col-md-6 p-0">
<img src="https://www.petittrain-quiberon.com/files/tao/img/demo/background-1.jpg" class="w-100" >
</div>
<div class="col-md-6 bg-dark text-white p-0">
<div class="py-5 px-3 explain">Lump LumpLump LumpLump LumpLump LumpLump LumpLump LumpLump LumpLump LumpLump LumpLump Lump</div>
<div class="py-5 px-3">
<div class="row m-0">
<div class="btn btn-primary col-md-5">Ok</div>
<div class="btn btn-secondary col-md-5 offset-md-2">Cancel</div>
</div>
</div>
</div>
</div>
</div>
</body>