How do I keep both columns the same height when reducing the window size?
I have two columns with more content on the left one and a single image on the right. When I reduce the screen size the right column becomes shorter... I want them both to always be the same height. How can I do this?
.right-image {
height: 35vw;
background-position:center;
background-size:cover;
border: 1px solid green;
}
.image-left div {
background-position: center;
background-size: cover;
height: 15vw;
}
.image-left {
padding: 40px;
margin-top: auto;
margin-bottom: auto;
}
.left-col {
border: 1px solid red;
display: flex;
flex-direction: column;
}
.title, .text {
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid red;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-6 left-col">
<div class="title">
<h2>This is a title</h2>
</div>
<div class="text">
<strong>KEEP BOTH COLUMNS THE SAME HEIGHT WHEN RESIZING TO SMALLER SCREEN SIZES</strong> </br>faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Nulla quis lorem ut libero malesuada feugiat. Pellentesque in ipsum id orci porta dapibus. Quisque velit nisi, pretium ut lacinia in, elementum id enim.
</div>
<div class="image-left">
<div style="background-image:url('https://images.unsplash.com/photo-1496449903678-68ddcb189a24?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1500&q=80')"></div>
</div>
</div>
<div class="col-6 right-image" style="background-image:url('https://images.unsplash.com/photo-1493612276216-ee3925520721?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80');">
</div>
</div>
</div>