html - Nested <div> (with flex box) in IE does not fill full height of parent element -


i have <div>s nested inside container fixed height , want child elements fill whole height of parent elements. works great in chrome, fails in ie (11 on windows 8).

(left: ie right: chrome)

ie chrome

i'm using angular material want try stick layout css styles if possible.

example: codepen

html:

<div style="height: 150px;width: 100%">   <div style="background:#f00;border: 1px solid black;"        layout-fill        layout>     <div style="background:#ccc"          layout-fill>       test     </div>   </div> </div>  <div style="height: 150px;width: 100%">   <div style="background:#f00;border: 1px solid black;"        layout-fill        layout>     <div style="background:#ccc"          flex>       test     </div>   </div> </div> 

css: (vendor prefixes exist in example)

[flex] {   box-sizing: border-box;   flex: 1; }  [layout] {   box-sizing: border-box;   display: flex; }  [layout-fill] {   margin: 0;   min-height: 100%;   width: 100%; } 

has encountered kind of issue , knows how can fix it?

if you're using angular along angular-material, consider using layout="row/column". tested using ie11 , chrome below.

http://codepen.io/anon/pen/oxyepy

<script>   angular.module('myapp').controller('appctrl', function($scope) {}); </script>  <div ng-controller="appctrl" ng-app="myapp">   <div style="height: 150px;width: 100%">     <div style="background:#f00;border: 1px solid black;display: " layout-fill>       <div style="background:#ccc" layout-fill>         section (no layout, no flex)       </div>     </div>   </div>    <div layout="row" style="height: 150px">     <div layout="column" style="background:#0005ef;border: 1px solid black;" flex>       <div style="background:#ccc">         section b (using layout, without flex)       </div>     </div>   </div>    <div layout="row" style="height: 150px">     <div layout="column" style="background:#0fff00;border: 1px solid black;" flex>       <div style="background:#ccc" flex>         section c (using layout, flex)       </div>     </div>   </div> </div> 

i got rid of css/js file purpose of example. hope helps anyway.

link layouts in angular material: https://material.angularjs.org/latest/#/layout/container


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -