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

前端 未结 13 1303
囚心锁ツ
囚心锁ツ 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:12

    I tried this and it works fine so far

    position:absolute;
    bottom:0;
    width:100%;
    

    or

    position:absolute;
    bottom:0;
    left:0;
    right:0;
    

提交回复
热议问题