显示:flex在Internet Explorer上不起作用 [英] display: flex not working on Internet Explorer
问题描述
My flex容器:
.back_pattern {
display:flex;
显示:-ms-flexbox;
-ms-flex-pack:center;
flex-direction:column;
align-content:center;
justify-content:center;
最小高度:100vh;
宽度:100%;
}
在其他浏览器上一切正常。
ie11:< a href =http://take.ms/68dHo =nofollow noreferrer> http://take.ms/68dHo ;
chrome:
截图和从 caniuse.com
已知问题:
- IE 11需求需要将一个单元添加到第三个参数中,flex-basis属性请参阅MSFT文档。
- 在IE10和IE11中,带有
的容器显示:flex $如果容器有
min-height $ c $,那么c $ c>和
的默认值为<$>flex-direction:column
将无法正确计算其折叠后的儿童的尺寸c>但不显式height
属性。 flex c $ c> 0 0 auto 而不是 - 当使用
min-height
时,IE 11不会正确地将项目对齐。 查看错误。
0 1 auto
在最新规范中定义 解决方法
<一个href =https://github.com/philipwalton/flexbugs =noreferrer> Flexbugs 是社区策划的Flexbox问题列表和针对它们的跨浏览器解决方案。以下列出了所有可用解决方法的错误以及影响到的浏览器。
- 弹性项目的最小内容大小不符合 com / philipwalton / flexbugs#flexbug-2rel =noreferrer>将列flex项设置为
align-items:center
溢出其容器 -
min-height
在柔性容器上不适用于其flex项目 -
flex
无单位基于flex-basis
的速记声明被忽略 - 专栏
flex
项目don总是保留内在的长宽比 - 默认弹性值已更改
-
flex-basis
不包含box-sizing:border- box
-
flex-basis
不支持calc()
- 一些HTML元素不能是flex容器
-
align-items:baseline
不会使用嵌套的柔性容器 - 最小值和最大值尺寸声明在包装弹性物品时被忽略
- 当使用flex速记时,重要性在flex的基础上被忽略 使用
flex-flow:列换行
缩小至合适的容器不包含其项目
- Column flex items忽略
margin:auto
横轴
flex-basis
不能动画
- 当使用
max-width
时,Flex项目没有正确对齐
- Column flex items忽略
My flex container:
.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%;
}
On other browsers everything works.
ie11 : http://take.ms/68dHo ;
chrome : http://take.ms/JhcEH
What's problem?
Internet Explorer doesn't fully support Flexbox due to:
Partial support is due to large amount of bugs present (see known issues).
Screenshot and infos taken from caniuse.com
Known issues:
- IE 11 requires a unit to be added to the third argument, the flex-basis property see MSFT documentation.
- In IE10 and IE11, containers with
display: flex
andflex-direction: column
will not properly calculate their flexed childrens' sizes if the container hasmin-height
but no explicitheight
property. See bug. - In IE10 the default value for
flex
is0 0 auto
rather than0 1 auto
as defined in the latest spec. - IE 11 does not vertically align items correctly when
min-height
is used. See bug.
Workarounds
Flexbugs is a community-curated list of Flexbox issues and cross-browser workarounds for them. Here's a list of all the bugs with a workaround available and the browsers that affect.
- Minimum content sizing of flex items not honored
- Column flex items set to
align-items: center
overflow their container min-height
on a flex container won't apply to its flex itemsflex
shorthand declarations with unitlessflex-basis
values are ignored- Column
flex
items don't always preserve intrinsic aspect ratios - The default flex value has changed
flex-basis
doesn't account forbox-sizing: border-box
flex-basis
doesn't supportcalc()
- Some HTML elements can't be flex containers
align-items: baseline
doesn't work with nested flex containers- Min and max size declarations are ignored when wrapping flex items
- Inline elements are not treated as flex-items
- Importance is ignored on flex-basis when using flex shorthand
- Shrink-to-fit containers with
flex-flow: column wrap
do not contain their items - Column flex items ignore
margin: auto
on the cross axis flex-basis
cannot be animated- Flex items are not correctly justified when
max-width
is used
这篇关于显示:flex在Internet Explorer上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!