css - Bootstrap 3 响应高度

标签 css twitter-bootstrap-3

我正在使用 Bootstrap 3 在页面上显示一些面板,但我希望面板主体在页面上具有 100% 的高度,但我的 CSS 知识显然还不够。

如果我指定一个高度(比如 100 像素),那么它会获得高度,但它没有响应。

有人知道我该怎么做吗?

我在这里设置了一个 JSFiddle:http://jsfiddle.net/skeniver/47CZ6/5/

<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            Heading
        </div>
        <div class="panel-body">
        </div>
    </div>
</div>

最佳答案

试试这个。这不会覆盖您的 Bootstrap 基础 CSS。

http://jsfiddle.net/YzHu4/

HTML

<div class="container m100">
    <div class="panel panel-default m100">
        <div class="panel-heading">
            Heading
        </div>
        <div class="panel-body m100">            
        </div>
    </div>
</div>

CSS

html,body{height:100%;}
.m100 {
    height:100%;
    min-height:100%;
}

关于css - Bootstrap 3 响应高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21576126/

相关文章:

html - 一个流动的 div 正在将它旁边的一个固定的 div 向下推。它也没有达到预期的高度

css - Quirks 模式与标准模式中的 Internet Explorer 表单样式问题

jquery - 移动导航菜单 - 响应格式

php - 无法在输出中获得预期的字体

jquery - 可以将此脚本与媒体查询一起使用吗?

html - 根据内容使页脚底部一致

html - Bootstrap grid,get less than col -xx-1

html - 页脚 float 在 div 之上

twitter-bootstrap-3 - Bootstrap 3 等高缩略图(就像 Bootstrap 4 中的等高卡片)

html - 保持图像比例并显示在 div 中间的问题