html - Incorrect flexbox display in Chrome 48 -
i'm having problem functionality of flexboxes in chrome. wanted make block picture , description in it, decided use flexboxex. have flexbox parent, has 2 child divs in it. first child take 30% of width, , latter 70%. problem chrome 48 doesn't keep image ratio , stretches height. how looks like
chrome 48: flexbox display in chrome 48
but ok in chrome 39 , mozilla. how can workaround problem, or did make mistakes in code, displays incorrectly in actual chrome version? thanks!
here fiddle code example
.parent0 { display: flex; width: 100%; } .child1 { width: 30%; justify-content: center; align-items: center; display: flex; flex-direction: column; } .child2 { width: 70%; justify-content: center; align-items: center; display: flex; } .image { width: 50%; display: block; }
<div class="parent0"> <div class="child1"> <img class="image" src="http://keo.kz/img/headblack.png"> <img class="image" src="http://keo.kz/img/headblack.png"> </div> <div class="child2"> <div> lorem ipsum dolor sit amet, consectetur adipiscing elit. aenean malesuada lacinia lacus, ut porta ipsum luctus sit amet. pellentesque dapibus massa in eros ullamcorper, vel hendrerit lectus porttitor. class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. phasellus tristique, magna vitae venenatis cursus, urna elit viverra dolor, malesuada libero lacus eu ex. nullam velit risus. vestibulum cursus arcu quis tellus iaculis, faucibus ipsum aliquam. pellentesque id magna mauris. nunc commodo metus eu justo feugiat, in bibendum dui porta. nullam tempor, felis quis sollicitudin commodo, odio mauris suscipit metus, pulvinar malesuada diam dui vel leo. nam porta , elit id venenatis placerat. donec fringilla lectus quam, nec suscipit nibh feugiat semper. nunc ut tincidunt purus. </div> </div> </div>
indeed, there annoying bug in chrome 48 flexbox broken, mentioned here:
https://github.com/angular/material/issues/6841
my suggested fix css is:
.image { width: 50%; display: block; min-height: 0; min-width: 0; }
Comments
Post a Comment