I am trying to produce a vertical stack of two images that scale with different viewport sizes. I wish that all images preserve their aspect ratio and use flexbox (not an absolute requirement but ideal).
Right now my HTML is like this
<div class="fullwidth">
<div class="verticalimages">
<img src="http://placehold.it/500x600">
<img src="http://placehold.it/500x600">
</div>
</div>
with CSS
.fullwidth{
width:100%;
}
.verticalimages{
display: flex;
flex-direction: column;
width: 33.3%;
height: calc(33.3% * 600 / 500);
}
The width of the images scale accordingly but not the height. What am I doing wrong?
I have the code here: