I'm trying to make 100% height flex's child as described here and here . In firefox and IE it's shown as expected, but in chrome it's messed up. The divs are getting out of the body. Is it yet another side effect of chrome following the spec to the tee or still a bug?
The code:
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
div {
border: 1px solid black;
box-sizing: border-box;
margin: 0;
padding: 0;
}
.red-border {
border: 2px solid red;
}
.blue-border {
border: 2px solid blue;
}
.green-border {
border: 2px solid green;
}
</style>
</head>
<body class="red-border" >
<div clsas="blue-border" style="display: flex; flex-direction: column; width: 100%; height: 100%;">
<div style="flex: 0 1 auto; ">top</content></div>
<div class="green-border" style="flex: 1 1 auto; display: flex; flex-direction: row; width: 100%; height: 100%;" >
<div style="flex: 0 1 auto; ">left</div>
<div style="flex: 1 1 auto; width: 100%; height: 100%;">
<div style="background-color: #ff6500; width: 100%; height: 100%;">center</div>
</div>
<div style="flex: 0 1 auto; ">right</div>
</div>
<div style="flex: 0 1 auto; ">bottom</content></div>
</div>
</body>
</html>
plnkr: http://run.plnkr.co/plunks/wi5MQYK5yEdzdgQBaUWh/
that's how it looks in ff and ie (11):
UPDATE: The 'center' div should be a non-flex div and still have to have 100% height. The reason is to have non-flex div is that my real site structure is quite complicated - it uses a lot of webcomponents and some of them just can't use flex. So at some point I have to stop using flex and have 'normal' div to have height 100%.