I am trying to make a DIV fill its whole parent container with pure CSS. height:100%
doesn't do it and flexbox or display:table
on the parent also didn't help :(
In the attached code, we're talking about the innermost
div.CodeMirror
The problem occurs in the latest Safari on MacOS. In Chrome all is fine.
html, body, #root {
margin: 0;
padding: 0;
height: 100%;
}
.App {
display: flex;
flex-flow: column;
height: 100%;
}
div.editorContainer {
flex: 1 1 auto;
display: flex;
margin-bottom: 1em;
}
div.ReactCodeMirror {
padding: 5px;
width: 100%;
background-color: #ddf;
}
.CodeMirror {
height: 100%;
border: 1px solid #ccc;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div id="root">
<div class="App">
<nav class="navbar navbar-default"></nav>
<div class="editorContainer">
<div style="background-color: #aaf; width: 160px;">Side bar</div>
<div class="ReactCodeMirror">
<div class="CodeMirror">Should fill light blue area</div>
</div>
</div>
</div>
</div>