2014-02-17 44 views
2

我试图让一个粘性的页脚工作,但我的问题是我需要嵌套的div #container一直扩展到页脚。我尝试了各种方法,但无法取得任何进展。粘性页脚与嵌套div推内容

当内容短时,页脚应该粘到底部。

<body> 
    <div id="wrapper"> 
     <div id="header">click here to reset</div> 
     <div id="banner-region">click here to add content</div> 
     <div id="navigation"></div> 
     <div id="content"> 
      <div id="container"> 
       <p>This div should extend all the way down to the bottom and touch the footer</p> 
      </div> 
     </div> 
    </div> 
    <div id="footer"></div> 
</body> 

小提琴: http://jsfiddle.net/Vu2uP/3/

+0

可能是'Flexbox的情况下'。 – CBroe

+0

“粘脚”是什么意思?你是否希望页脚始终可见,并将内容滚动到后面? – jonsuh

+1

@jonsuh不,对不起。我的意思是,页脚始终位于页面的底部,即使背景为短内容 – jmorc

回答