twitter-bootstrap 用 Bootstrap 填充剩余高度
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28748158/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fill remaining height with Bootstrap
提问by JQuery Mobile
I have a web page. My web page uses Bootstrap version 3. Currently, it looks something like this:
我有一个网页。我的网页使用 Bootstrap 版本 3。目前,它看起来像这样:
<div class="row">
<div class="col-lg-4">
Stuff here
</div>
<div class="col-lg-8">
Other stuff here
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div id="fillAvailableSpace">
[Main content goes here]
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
Other text goes here
</div>
<div class="col-lg-6 pull-right">
Some text goes here
</div>
</div>
I need the divwith the id "fillAvailableSpace" to fill the available height of the screen with the exception of the size of the first row and the last row. How do I fill the remaining available height of a page with Bootstrap?
我需要divid 为“fillAvailableSpace”来填充屏幕的可用高度,但第一行和最后一行的大小除外。如何使用 Bootstrap 填充页面的剩余可用高度?
采纳答案by Sleek Geek
Try something like below:
尝试如下:
Element-name {
display: inline-flex;
height: 100%;
}

