I have a problem with flexbox in Safari and I can't find a solution on these pages that works for me.
On my page I have used flexbox and have placed text in one column and a picture in the other. It views perfectly in Chrome and Internet explorer, however in Safari the image is shrunk and becomes very small or misplaced.
the CSS code:
.flexbox {
display: -webkit-flex; /* Safari */
-webkit-align-items: center; /* safari */
-webkit-justify-content: center; /* safari */
display: -ms-flexbox;
display: flex;
overflow: hidden;
flex-wrap: nowrap;
}
.flexbox .col {
flex: 1;
padding: 20px;
}
.flexbox .col:nth-child(1) {
/* background: #ccc; */
-webkit-order: 1;
-ms-flex-order: 1;
order: 1;
}
.flexbox .col:nth-child(2) {
/* background: #eee; */
-webkit-order: 0;
-ms-flex-order: 0;
order: 0;
}
.flexbox .col:nth-child(3) {
/* background: #eee; */
-webkit-order: 2;
-ms-flex-order: 2;
order: 2;
}
HTML:
<div class="flexbox">
<div class="col">
<img src="image url">
</div>
<div class="col">
contents of column 2
</div>
</div>
I have tried to add flexbox-shrink: 0;
and flex: 1 0 auto;
to .flexbox
and .col
respectively in the CSS but with no effect other than also causing problems in chrome.
I have made a codepen here: http://codepen.io/anon/pen/meWZgW. Open it in chrome/firefox or similar and then in safari to see the problem.
Would really appreciate some input here, I just can't figure it out!
thanks!