flex-grow在Internet Explorer 11中不起作用 [英] flex-grow not working in internet explorer 11

查看:149
本文介绍了flex-grow在Internet Explorer 11中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hy

我在IE中使用flex遇到了一些麻烦:

I'm having some trouble with flex in IE:

http://jsfiddle.net/EvvBH/

请注意#两个元素具有 flex:auto ,即使没有足够的内容,也应该将其扩展以填充容器。

Notice that the #two element has flex: auto, which is supposed to expand it to fill the container, even if there's not enough content.

但是它只能在Chrome和Firefox中执行。

But it does that only in Chrome and Firefox. In IE it simply doesn't work.

是IE不支持的 flex-grow 吗?

推荐答案

以防有人尝试在身体上而不是孩子div上尝试。
您可以设置高度:0;

In Case someone is trying this not on body but some child div. You can just set height: 0; on the element with the min-height.

IE只是想要flex-grow auto元素的父元素上的任何高度。

IE just wants any height on the parent element of the flex-grow auto element.

所以它看起来像这样:

.flex-parent{
  display: flex;
  min-height: 300px;
  height: 0;
}
.flex-child{
  flex: 1 1 auto;
}

这篇关于flex-grow在Internet Explorer 11中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆