【发布时间】:2018-02-07 10:43:58
【问题描述】:
我想要一个类似桌面的全页宽度布局。 顶部的一些菜单(未知高度,取决于内容), 和下面的 div 占用视口中的所有可用空间。
div {
padding: 0px
}
html,
body {
height: 100%;
padding: 0px;
margin: 0px;
}
.outer {
background: olive;
height: 100%;
}
.menu {
background: orange;
}
.should_fill_available_space {
background: brown;
}
<div class="outer">
<div class="menu">
Lorem Ipsum Lorem Ipsum Lorem Ipsum
</div>
<div id="this" class="should_fill_available_space">
Brown color should go all the way down
</div>
</div>
我有一个用于这种情况的代码笔: https://codepen.io/marek-zganiacz/pen/NvEaxr
我希望should_fill_available_space 一直向下,例如menu 将有height:10% 和should_fill_available_space 有'height:90%`。
【问题讨论】:
标签: javascript html css