【发布时间】:2017-05-31 11:33:39
【问题描述】:
我想知道:是否可以使用 flexbox 构建 3 行布局、100% 高度?
<header> The header content goes here. </header>
<div class="content"> The main content goes here. </div>
<footer> The footer content goes here. </footer>
固定高度的页眉和页脚,而内容是液体部分。
我的意思是,像这样但没有绝对定位:
* {
margin: 0;
}
header {
position: absolute;
width: 100%;
height: 64px;
top: 0;
background: red;
}
footer {
position: absolute;
width: 100%;
height: 64px;
bottom: 0;
background: green;
}
.content {
position: absolute;
width: 100%;
top: 64px;
bottom: 64px;
background: blue;
}
<header>The header content goes here.</header>
<div class="content">The main content goes here.</div>
<footer>The footer content goes here.</footer>
【问题讨论】:
-
类似this
-
@Michael_B 好的,谢谢,我添加了自己的答案以及适当的文档。