Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE10 Flexbox P element non-wrapping

http://jsfiddle.net/pvJRK/2/

Basically in IE10 a p element which has text wider than it's parent when the "direction" is a row, will overflow, and subsequently push any other siblings out of the container. The wrapping appears to work fine in column mode (and you can view the same jsfiddle in Chrome and see it behave as expected).

<div id="flex-one">     <p>Some extra long content (for the container) that correctly wraps!</p>     <aside>Content</aside> </div>  <div id="flex-two">     <p>Some extra long content (for the container) that incorrectly wraps!</p>     <aside>Content</aside> </div>  div {     width: 250px;     padding: 1em;     background: blue;     display: -webkit-flex;     display: -ms-flexbox;     margin-bottom: 1em; }  #flex-one {     -webkit-flex-flow: column;     -ms-flex-direction: column; }  #flex-two {     -webkit-flex-flow: row;     -ms-flex-direction: row; }  p {     margin: 0;     padding: 0;     background: yellow; }  aside {     background: red; } 

Any ideas on how to correct this behavior so that it doesn't overflow it's container? (without supplying a fixed with as this is used in a fluid layout).

like image 343
ct5845 Avatar asked May 29 '13 08:05

ct5845


People also ask

Does ie10 support Flexbox?

The two browsers you should still keep in mind for cross-browser compatibility are: Internet Explorer 10, which implemented the display: flexbox version of the specification with the -ms- prefix.

Why is Flexbox wrapping?

The flex-wrap property is a sub-property of the Flexible Box Layout module. It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.

How do I wrap my Flexbox?

Making things wrap If you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap , or use the shorthand flex-flow with values of row wrap or column wrap . Items will then wrap in the container.


1 Answers

It doesn't make any sense to me, but adding -ms-flex: 0 1 auto or -ms-flex: 1 1 auto to the paragraph and aside corrects it in IE10. By default, elements are supposed to have flex: 0 1 auto applied to them when they become flex items.

http://jsfiddle.net/pvJRK/3/

like image 159
cimmanon Avatar answered Sep 28 '22 00:09

cimmanon