【发布时间】:2018-01-07 01:50:55
【问题描述】:
我正在尝试使用 Flexboox 和 Bootstrap 4 实现这种布局:
- 顶部固定标题
- 修复了左侧边栏
- 流畅的内容区
我不知道如何修复页眉和侧边栏。到目前为止,其他一切都按我的意愿工作:
HTML:
<header>
header
</header>
<app>
<nav>
nav
</nav>
<article>
Content
</article>
</app>
CSS:
html, body {
margin:0;
height:100%;
min-height:100%;
}
body {
margin:0;
display: flex;
flex-direction: column;
}
header {
z-index: 0;
flex: 0 64px;
display: flex;
background: white;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.24);
}
app {
flex: 1;
display: flex;
}
nav {
background: #FAF9F8;
flex: 0 0 256px;
order: 0;
border-right: 1px solid #d9d9d9;
}
article {
background: #F3F3F5;
flex: 1 1 100px;
order: 1;
// Simulate large height
height: 2000px;
}
【问题讨论】:
标签: twitter-bootstrap css flexbox bootstrap-4