I have a simple flexbox layout like this...
html, body {
margin:0;
padding:0;
}
.container {
display:flex;
flex-direction:row;
}
.section1 {
width:50%;
}
.section2 {
width:50%;
}
.img_16x9_holder {
display: block;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
}
img {
max-width:100%;
}
<div class="container">
<div class="section1">
<div class="img_16x9_holder">
<img src="http://lorempixel.com/g/800/800/" alt="800x800image">
</div>
<div class="section2">
<div class="img_matchheight_holder">
<img src="http://lorempixel.com/g/300/650/" alt="300x650image">
</div>
</div>
</div>
I am trying to set the left image to a 16x9 ratio and then the right hand one should crop and fill to match the height of the left.
This is what I am trying to achieve..
Can I do this using CSS alone, or am I best off looking at a javascript height matching solution?