Html 全高 - 网页响应 - Twitter Bootstrap
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15230949/
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
Full height - Web Responsive - Twitter Bootstrap
提问by Alan Gularte
Someone know how to set, in Twitter Bootstrap, a div to be always in full height (100% of screen height), in all resolutions?
有人知道如何在 Twitter Bootstrap 中将 div 设置为在所有分辨率下始终处于全高(屏幕高度的 100%)?
I'll really appreciate any help.
我真的很感激任何帮助。
回答by Zim
Basically any parent containers of the DIV need to also be 100% -- this includes BODY, HTML, etc.. You can add some CSS following the 'bootstrap.css' to override the Bootstrap CSS like this:
基本上,DIV 的所有父容器也需要 100%——这包括 BODY、HTML 等。您可以在“bootstrap.css”之后添加一些 CSS 来覆盖 Bootstrap CSS,如下所示:
html,body{height:100%;}
.container {
height:100%;
}
.fill{
width:100%;
height:100%;
min-height:100%;
background-color:#990000;
padding:10px;
color:#efefef;
}