I have a 2 column flexbox layout.
The first column has a child element (an image) that is quite large. The reason it's large, is so it looks good on Retina displays. The image use max-width:100% to scale.
In Chrome the layout works fine. But in Firefox/IE, the image breaks the layout. Is there any way to get it display properly?
Here is a Codepen of the layout: http://codepen.io/madhusharma/pen/YXNbVE
Here is the HTML:
<div class="container">
<div class="unit-body reading-style">
<div class="unit-aside">
<img src="http://placehold.it/1077x1000"/>
</div>
<div class="unit-main">
<p>Text</p>
</div>
</div>
</div>
Here is the CSS:
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
.container {
max-width:960px;
margin:auto;
}
.unit-body {
display: flex;
flex-flow: row wrap;
}
.unit-aside {
flex: 1 50%;
padding: 10px;
}
.unit-main {
flex: 1 50%;
padding: 10px;
}
img {
max-width:100%;
height:auto;
}