【问题标题】:display: flex won't render properly in IE11显示:flex 无法在 IE11 中正确呈现
【发布时间】:2019-08-02 02:04:35
【问题描述】:

我有这个代码:

.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

有人知道为什么吗?

【问题讨论】:

  • 在我的 IE 浏览器中看起来不错。你确定你用的是IE11?您可以交换版本进行测试
  • @MarcHjorth 这就是About IE 所说的......所以我猜它在撒谎。
  • 你检查你的兼容模式了吗? (按 f12 并在选项卡上选择兼容模式或仿真) - 这在我的 ie11 上的 windows 10 上工作正常
  • @Pete 好的,就是这样,基本上是 Windows 10 中的 Internet Explorer 11,默认为 IE 7 的兼容模式...写下你的答案,我会投票给它。
  • 请注意,IE 可能默认为 localhost URL 的兼容模式,但肯定不是所有的。请参阅 here 和 here。除非有人在您的计算机上进行了更改

标签: html css flexbox internet-explorer-11


【解决方案1】:

布局在 IE11 上运行良好。

但是,您可能需要检查浏览器的兼容性设置。

按 F12,转到“仿真”选项卡,检查“文档模式”是否设置为 IE11。

【讨论】:

    猜你喜欢
    • 2017-11-01
    • 1970-01-01
    • 2013-10-26
    • 2018-05-06
    • 2020-05-19
    • 2018-04-30
    • 2016-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多