Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flex-grow not working in internet explorer 11 [closed]

Tags:

Hy

I'm having some trouble with flex in IE:

http://jsfiddle.net/EvvBH/

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.

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

is flex-grow not supported by IE ?

like image 631
katie Avatar asked Jun 24 '14 21:06

katie


People also ask

Does IE 11 support Flexbox?

Note also that Internet Explorer 11 supports the modern display: flex specification however it has a number of bugs in the implementation.

How do you get the flex element to take all available space?

Use the flex-grow property to make a flex item consume free space on the main axis. This property will expand the item as much as possible, adjusting the length to dynamic environments, such as screen re-sizing or the addition / removal of other items.

What flex property should we use to make a flex item to grow if necessary in a Flex container?

The flex-grow property is a sub-property of the Flexible Box Layout module. It defines the ability for a flex item to grow if necessary. It accepts a unitless value that serves as a proportion. It dictates what amount of the available space inside the flex container the item should take up.


1 Answers

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 just wants any height on the parent element of the flex-grow auto element.

So it could look like this:

.flex-parent{   display: flex;   min-height: 300px;   height: 0; } .flex-child{   flex: 1 1 auto; } 
like image 142
Rory Avatar answered Sep 21 '22 03:09

Rory