我正在尝试使DIV使用纯CSS填充其整个父容器。 height:100%
没有做到这一点,在父Flexbox的或display:table
也没有帮助:(Div应填充父级高度
在所附的代码中,我们谈论的最里面 div.CodeMirror
在最新的Safari浏览器上出现的问题MacOS的。在Chrome中所有的罚款。
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>
制作'.ReactCodeMirror'' display:flex'。 – CBroe
@CBroe:没有帮助(MacOS上的最新的Safari) – travelboy
可能的重复:http://stackoverflow.com/q/33636796/3597276 –