引导容器中具有100%高度的内容

时间:2013-01-29 11:59:45

标签: css twitter-bootstrap

我需要帮助css,html&引导。

我怎样才能得到这样的效果: Layout

  1. 标题= Boostrap导航栏(50px高度)
  2. Container =所有网站和中心内容的灰色背景
  3. 左栏=菜单 - 宽度220px
  4. 右栏=具有白色背景和100%高度的内容
  5. 页脚=粘性页脚(高度:50px)
  6. 我要使用中心:

    <div class="container">
    

    但我有100%高度内容和粘性页脚的问题。

2 个答案:

答案 0 :(得分:2)

你应该把你的css和html放在这里,这样任何人都可以轻易地建议你。

对于粘性页脚,您需要将其位置设置为绝对,并将主要div的位置设置为相对。

喜欢:

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

.container { 
    min-height: 100%;
    height: 100%;
    position: relative;
}

.footer
{
    height: 20px; //according to your requirement
    position: absolute;
    bottom: 0px;
}

答案 1 :(得分:1)

您需要执行以下操作:Twitter Bootstrap: div in container with 100% height

html, body {
    height: 100%;
}

.container { 
    min-height: 100%;
    height: 100%;
}