I have a ul > li > a > img
parenthesis and am using flexbox to align all list items on to a single row whilst the images are maintaining their aspect ratio's.
What it looks like in Chrome 45, Firefox 40, Safari 8, Opera 28 & Edge
What it looks like in IE 10/11
So my problem is that i'm trying to achieve in IE the same behaviour as i have in Chrome and Firefox.
My SASS/SCSS
ul.images {
float: left;
clear: both;
width: 100%;
min-height: auto; // Required for Firefox
padding: 0;
margin: 0;
border: 1px solid yellow;
display: -webkit-flex;
-webkit-flex-direction: row;
display: -ms-flexbox;
-ms-flex-direction: row;
display: flex;
flex-direction: row;
li {
border: 2px solid green;
flex: 1 1 auto;
width: auto;
min-width: 0; // Required by Firefox
max-width: 100%;
max-height: auto;
img {
float: left; // Removes phantom margin
width: auto;
max-width: 100%;
height: auto;
max-height: 100px;
}
}
}
Here is a CodePen for anyone wanting a more detailed look.
Note also that Internet Explorer 11 supports the modern display: flex specification however it has a number of bugs in the implementation.
To override this behavior, use min-width: 0 or overflow: hidden .
By default, the child elements of a flexbox container will stretch vertically to fill the height of the container. This can be prevented by using the align-self property on the child element that you do not want to stretch. This Pen is owned by dev on CodePen.
Change the <img>
width from auto to 100%
img {
width: 100%;
max-width: 100%;
height: auto;
max-height: 100px;
}
It seems that's Chrome who doesn't respect standard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With