显示:flex 无法在 IE11 中正确呈现
display: flex won't render properly in IE11
我有这个代码:
.fbox {
display: flex;
flex-direction: row;
justify-content: center;
}
.box {
width: 200px;
height: 200px;
margin: 15px;
border: 1px solid black;
background-color: gray;
}
<div class="fbox">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
而不是得到这个:
我明白了:
就 caniuse 和其他相关来源的说明而言,Internet Explorer 11 应该支持 display: flex
和 flex-direction: row
。
我测试的版本是:IE 11.1.18343.0
有人知道为什么吗?
布局在 IE11 上工作正常。
但是,您可能需要检查浏览器的兼容性设置。
按 F12,转到 "Emulation" 选项卡,检查 "Document Mode" 是否设置为 IE11。
我有这个代码:
.fbox {
display: flex;
flex-direction: row;
justify-content: center;
}
.box {
width: 200px;
height: 200px;
margin: 15px;
border: 1px solid black;
background-color: gray;
}
<div class="fbox">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
而不是得到这个:
我明白了:
就 caniuse 和其他相关来源的说明而言,Internet Explorer 11 应该支持 display: flex
和 flex-direction: row
。
我测试的版本是:IE 11.1.18343.0
有人知道为什么吗?
布局在 IE11 上工作正常。
但是,您可能需要检查浏览器的兼容性设置。
按 F12,转到 "Emulation" 选项卡,检查 "Document Mode" 是否设置为 IE11。