Wrapping flex items in IE11 is broken

给你一囗甜甜゛ 提交于 2019-12-05 19:37:56

Just ran into a similar problem three and a half years later. When a flexible container will overflow and its size is not given, sometimes IE will try to increase the container's size instead of wrapping the items (in contrast to the article linked by the thread creator, which states that won't happen anymore).

In your case you might want to try setting width: 100%;, or in fact any width value, to the container.

It looks like you are calling display: flex; on nearly every element. Only the container that needs to be flexible should have that property. Here's what I've come up with, and it seems to be working the way you've requested.

* {
    margin: 0px;
    padding: 0px;
}

body {
    background-color: black;
    font-family: Verdana sans-serif;
    font-size: 20px;
}

#content_wrapper {
    box-sizing: border-box;
    padding: 20px 20px;
    width: 100%;
    height: 100%;
}

#main_wrapper {
    display: flex;
    min-height: 20px;
    overflow: hidden;
    border: 5px solid red;
}

#right {
    flex: 1 auto;
    width: 400px;
    background: #cccccc;
}

fieldset {
    margin: 10px 0px;
}

.fieldset {
    background-color: green;
    border: 1px solid blue;
}

#pdf {
    width: 100%;
    height: 100%;
}

img {
    width: 100%;
    height: 100%;
}


form {
    margin: 20px 20px;
}

.field {
    display: flex;
    margin: 10px 10px;
    border: 1px solid black;
    align-content: stretch;
    padding: 5px 5px;
}

.smallInput {
    /* flex: 1 0 0; */
}

.bigInput {
    /* flex: 2 0 0; */
}

input {
    flex: 2;
}

label {
    flex: 1;
    margin-right: 10px;
}

and here's an updated fiddle to see it in action.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!