Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex-direction column makes flex items overlap IE11

I'm running into an issue using flexbox in IE11. When using flex-direction: column the flex-items overlap:

enter image description here

In other browsers (chrome, safari) it looks like this:

enter image description here

.container {   display: flex;    flex-direction: column; } .flex {   flex: 1 1 0%; }
<div class="container">   <div class="flex">     Hello   </div>   <div class="flex">     World   </div> </div>

I've made a codepen to demonstrate the issue:

http://codepen.io/csteur/pen/XMgpad

What am I missing to make this layout not overlap in IE11?

like image 636
Chantal Avatar asked Mar 13 '17 13:03

Chantal


People also ask

How do I stop my Flexbox from overlapping?

The best solution I've come up with is to set the services images to overflow: hidden and the staff images to nowrap, this prevents images from either gallery from overlapping with any other elements.

Does Flexbox work in ie11?

Note also that Internet Explorer 11 supports the modern display: flex specification however it has a number of bugs in the implementation.

Which flex direction value stacks the Flex items vertically?

By default, a flex container aligns flex items in a row (like in your image). As mentioned in an answer, you can override the row default by specifying flex-direction: column, which stacks items vertically.

What does flex direction inherit do?

Definition and Usage The flex-direction property specifies the direction of the flexible items. Note: If the element is not a flexible item, the flex-direction property has no effect.


1 Answers

It is caused by the 0% in your .flex class. Change it to auto then it should not be a problem:

.flex {   flex: 1 1 auto; } 
like image 119
necilAlbayrak Avatar answered Sep 18 '22 18:09

necilAlbayrak