http://jsfiddle.net/pvJRK/2/IE10 Flexbox的P元素的非包裹
基本上在IE10具有文本的寬度大於它的父當「方向」是一個行的p元件,將溢出,並隨後將任何其他的兄弟姐妹出容器。包裝似乎在列模式下工作正常(你可以在Chrome瀏覽器中查看相同的jsfiddle並且看到它的行爲如預期)。
<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;
}
有關如何糾正這種行爲,以便它不會溢出它的容器的任何想法? (不提供固定的,因爲這用於流體佈局)。
謝謝發佈!我遇到了這個問題,但它是所有塊級印刷元素 - 段落和標題。這讓我瘋狂! – chipcullen
我想指出的原因是因爲IE10和11對flex項目有不同的默認值。這僅僅是因爲IE是無用的。 –
正如你可以閱讀[here](http://caniuse.com/#search=flex),IE10的默認值是'flex:0 0 auto;'。 –