I've come across a bit of tricky code and wonder if anybody can help me. I want the aspect ratio for the images of the door and elephant to be 3:2 exactly, and I want the height of the images to be exactly the same.
At the moment, the div container with the door is bigger than that with the elephant. How can these be the same size while keeping an exact 3:2 image aspect ratio?
Thanks a lot for any help!
#bg {
width: 100%;
background: yellow;
display: table;
}
#window-container {
width: 10%;
background: orange;
display: block;
float: left;
}
img {
width: 100%;
height: auto;
display: block;
}
#text-img {
width: 100%;
height: auto;
background: url('https://cml.sad.ukrd.com/image/638038.png');
}
#text-wrap {
background: lightblue;
padding: 10px;
}
<div id='bg'>
<div id='window-container'>
<img src='http://www.sickchirpse.com/wp-content/uploads/2017/08/Elephant.jpg'>
<!--<div id='test-img'></div>-->
<div id='text-wrap'>text goess here</div>
</div>
<div id='window-container'>
<img src='https://images.homedepot-static.com/productImages/7e02e385-820f-42de-85fc-8b3b4b6ec15c/svn/tangerine-mmi-door-doors-without-glass-z024086r-64_1000.jpg'>
<!--<div id='test-img'></div>-->
<div id='text-wrap'>text goes here</div>
</div>
</div>