How to push a footer to the bottom of page when content is short or missing?

前端 未结 13 1304
囚心锁ツ
囚心锁ツ 2020-12-04 16:55

I have a page with an outer div that wraps a header, content and footer div. I want the footer div to hug the bottom of the browser, even when the content div is not tall e

13条回答
  •  既然无缘
    2020-12-04 17:10

    Example : http://jsfiddle.net/AU6yD/

    html, body { height: 100%; }
    
    #wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -30px; }
    #bottom, #push { height:30px;}
    
    body { background:#333;}
    #header { height:30px; background:#000; color:#fff; }
    #footer { height:30px; background:#000; color:#fff; }

提交回复
热议问题