I want to make a typical Header/Content/Footer Layout in CSS with Flexbox. Header and Footer should have a fixed size. The Content should scale with the wrapper, so I thought I give it a flex property of 1.
Works pretty well, but I want to have a img in the Content div that scales up to 100% in height of the div.
For small Images it works but when it exceets the size of the content div, the div scales to the img??
I modeled the Problem:
.wrapper{
display: flex;
flex-direction: column;
height:200pt;
background: grey;
}
.a{
height:50pt;
background: blue;
}
.b{
flex: 1;
background: red;
}
.b img{
height:100%;
}
.c{
height:50pt;
background: green;
}
<div class="wrapper">
<div class="a"></div>
<div class="b">
<!--
With Small Image it works!
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/WLE_Austria_Logo_%28no_text%29.svg/50px-WLE_Austria_Logo_%28no_text%29.svg.png">
-->
<img src="https://i.chzbgr.com/full/7006036736/h52434C0A/computer-says-no">
</div>
<div class="c"></div>
</div>