【问题标题】:display: flex not working on Internet Explorer [duplicate]显示:flex 在 Internet Explorer 上不起作用 [重复]
【发布时间】:2017-10-14 06:01:28
【问题描述】:

我的弹性容器:

.back_pattern {
    display: flex;
    display: -ms-flexbox;
    -ms-flex-pack: center;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

在其他浏览器上一切正常。
ie11 : http://take.ms/68dHo ;
铬:http://take.ms/JhcEH
有什么问题?

【问题讨论】:

  • 你能给我们看更多你的代码吗?比如html和css?

标签: html css flexbox


【解决方案1】:

Internet Explorer 不完全支持 Flexbox,原因如下:

部分支持是由于存在大量错误(参见已知 问题)。

截图和信息取自caniuse.com

注意事项

Internet Explorer 10 之前的版本不支持 Flexbox,而 IE 11 仅支持 2012 syntax

已知问题

  • IE 11 要求将一个单位添加到第三个参数,即 flex-basis 属性,请参阅 MSFT 文档。
  • 在 IE10 和 IE11 中,如果容器具有 min-height 但没有明确的 height 属性,则具有 display: flexflex-direction: column 的容器将无法正确计算其伸缩子项的大小。 See bug
  • 在 IE10 中,flex 的默认值是 0 0 auto,而不是最新规范中定义的 0 1 auto
  • 使用min-height 时,IE 11 无法正确垂直对齐项目。 See bug

解决方法

Flexbugs 是一个社区策划的 Flexbox 问题列表和针对这些问题的跨浏览器解决方法。下面列出了所有错误以及可用的解决方法以及受影响的浏览器。

  1. Minimum content sizing of flex items not honored
  2. Column flex items set to align-items: center overflow their container
  3. min-height on a flex container won't apply to its flex items
  4. flex shorthand declarations with unitless flex-basis values are ignored
  5. Column flex items don't always preserve intrinsic aspect ratios
  6. The default flex value has changed
  7. flex-basis doesn't account for box-sizing: border-box
  8. flex-basis doesn't support calc()
  9. Some HTML elements can't be flex containers
  10. align-items: baseline doesn't work with nested flex containers
  11. Min and max size declarations are ignored when wrapping flex items
  12. Inline elements are not treated as flex-items
  13. Importance is ignored on flex-basis when using flex shorthand
  14. Shrink-to-fit containers with flex-flow: column wrap do not contain their items
  15. Column flex items ignore margin: auto on the cross axis
  16. flex-basis cannot be animated
  17. Flex items are not correctly justified when max-width is used

【讨论】:

    【解决方案2】:

    这个问题恐怕已经回答过几次了,如果有关系,请看下面

    【讨论】:

      猜你喜欢
      • 2015-12-16
      • 2014-04-29
      • 2013-03-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-15
      • 2012-12-18
      • 2019-07-23
      相关资源
      最近更新 更多