【发布时间】:2014-05-25 22:12:57
【问题描述】:
我有这样的事情:
+-------------------------------------------+
| -- navigation -- |
+------+------------------------------------+
| | |
| left | |
| side | |
| with | |
| affix| -- content (white) -- |
| menu | |
|-black| |
| | |
| | |
| +------------------------------------+
| | -- footer (white) -- |
+------+------------------------------------+
作为我在 TB 3.0 中的布局,以及一些代码:
<body>
<header>
<div class="row">
<div class="col-md-12>-- navigation (height = 50px) here --</div>
</div>
</header>
<div class="row">
<div class="col-md-4">-- left side with black background here --</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-12">-- content with white background here --</div>
</div>
<div class="row">
<div class="col-md-12">-- footer (height = 50px) with white background here --</div>
</div>
</div>
</div>
</body>
我想让我的左侧(黑色背景)和高度 = 100% 的浏览器窗口的内容(白色背景)和内容下方的页脚(白色背景)可见(也在滚动上)。
现在,我得到了边最后一个元素的高度。如果我的内容很短,它会在浏览器垂直边的中心结束。
【问题讨论】:
-
伙计,试图通过解释来遵循所有这些真的很令人困惑 - 你能在 codepen.io 上扔一些代码并链接到它吗?
-
我很抱歉 :) 我忘记了。我编辑了我的问题,并在最后添加了链接。
标签: twitter-bootstrap layout twitter-bootstrap-3 css