css - 如何将最小高度设置为 Bootstrap 中另一个 div 中的 div?

标签 css twitter-bootstrap

我正在使用 Twitter-Bootstrap 并为 div 类 main 设置了 min-height: 100%。但是,我无法为另一个 div 类 sub 设置 min-height: 70%

这是我的代码:

<div class="main col-xs-12">
    <div class="sub col-xs-6"></div>
</div>
.main
{
    min-height : 100%;
    border : 2px solid #000000;
}
.sub
{
    min-height : 70%;
    border : 2px solid #fffffff;
}

最佳答案

HTML

 <div class="main col-xs-12">
     <div class="sub col-xs-6"></div>
   </div>

CSS

body, html
{
    height:100%;
    min-height:100%;
}
.main
   {
       height:100%;
    min-height : 100%;
    border : 2px solid #000000;
   }
   .sub
   {
    min-height : 70%;
    border : 2px solid red;
   }

Fiddle

Full Page Demo

关于css - 如何将最小高度设置为 Bootstrap 中另一个 div 中的 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22323332/

相关文章:

javascript - 具有可隐藏公告/提示的站点

css - GZIP CSS 完全破坏页面

html - 如何将此响应式导航变成移动菜单?

CSS断行但不是单词

javascript - Twitter Bootstrap 模态

jquery - 带有负值的进度条.css(width, )

html - 2013 年我应该使用 HTML5 编写我的网站吗?

html - 如何隐藏 Bootstrap 导航栏默认图标

twitter-bootstrap - 打开第二个模式后,Bootbox 模式不可滚动

jquery - 固定右侧 Div 滚动