The following fiddle shows image ratio correctly in Chrome / Firefox.
However in Internet Explorer the images (which should be square) retain their original height in the flexbox layout when being resized to fit their container.
http://jsfiddle.net/minlare/knyagjk5/
<section>
<article>
<div class="details">
<img src="http://i.ytimg.com/vi/rb8Y38eilRM/maxresdefault.jpg" alt="face"/>
<h4>Name</h4>
<div class="description">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ultrices lectus. Curabitur molestie volutpat mattis.</p>
</div>
</div>
</article>
<article>
<div class="details">
<img src="http://i.ytimg.com/vi/rb8Y38eilRM/maxresdefault.jpg" alt="face"/>
<h4>Name</h4>
<div class="description">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ultrices lectus. Curabitur molestie volutpat mattis. Fusce fermentum auctor mauris, auctor lacinia mauris ornare faucibus.</p>
</div>
</div>
</article>
</section>
section{
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
article{
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
-webkit-align-items: stretch;
-moz-align-items: stretch;
align-items: stretch;
width: 50%;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 20px;
box-sizing: border-box;
}
.details{
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
width: 100%;
border: 1px solid #666;
}
.image{
width: 100%;
max-width: 100%;
}
img{
width: 100%;
max-width: 100%;
height: auto;
}
h4{
padding: 10px;
margin-bottom: 0;
}
.description{
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
How can this be prevented / fixed?