【问题标题】:Full height - Web Responsive - Twitter Bootstrap全高 - Web 响应式 - Twitter Bootstrap
【发布时间】:2013-02-20 06:37:28
【问题描述】:

有人知道如何在 Twitter Bootstrap 中将 div 设置为在所有分辨率下始终处于全高(屏幕高度的 100%)?

我将非常感谢任何帮助。

【问题讨论】:

    标签: html css twitter-bootstrap responsive-design


    【解决方案1】:

    基本上,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;
    }
    

    http://jsfiddle.net/skelly/zrBGw/

    【讨论】:

    • 在我的情况下(Windows + Chrome)我有一个垂直滚动条,因为填充:10px。使用 box-sizing:border-box;解决问题(我基本上是在改变盒子模型)。
    猜你喜欢
    • 2014-10-02
    • 1970-01-01
    • 1970-01-01
    • 2012-10-12
    • 1970-01-01
    • 1970-01-01
    • 2012-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多