简体   繁体   English

Internet Explorer 11 Flexbox问题

[英]Internet Explorer 11 flexbox issues

The code I've written works in every browser I've tested except IE 11. The problem seems to be here: 我编写的代码适用于我测试的每个浏览器,除了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;
}

If I remove flex, it becomes more manageable, but with them, it shrinks all the content into this long, narrow div that goes on forever. 如果我删除flex,它会变得更易于管理,但是对于它们,它会将所有内容缩小到这个长而窄的div中,这个div永远存在。

Would it help if I tested in IE 10? 如果我在IE 10中测试会有帮助吗?

You just need flex:1; 你只需要flex:1; It will fix issue for the IE11 它将解决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;
}

只需在身体上添加100%的宽度就可以解决我的问题。

尝试display: run-indisplay: inline-block而不是display: -ms-flexbox ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM