jay*_*key 5 html css flexbox internet-explorer-11
我编写的代码可在除IE 11之外的所有已测试浏览器中使用。问题似乎在这里:
#wrapper {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -o-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
width: 100%;
height: 100%;
position: relative;
top: 1em;
}
Run Code Online (Sandbox Code Playgroud)
如果我删除flex,它将变得更易于管理,但是有了它们,它将所有内容缩小到这个长而狭窄的div上,直到永远存在。
如果我在IE 10中进行测试会有所帮助吗?
您只需要flex:1; 它将解决IE11的问题
#wrapper {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -o-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
width: 100%;
height: 100%;
position: relative;
top: 1em;
flex:1;
}
Run Code Online (Sandbox Code Playgroud)