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

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

    I did what Jahmic up top did (won't let me comment yet) except I had to use VH instead of % since I couldn't just apply it to a container class.

    #inner-body-wrapper
    {
        min-height: 70vh;
        min-height: -webkit-calc(100vh - 186px);
        min-height: -moz-calc(100vh - 186px);
        min-height: calc(100vh - 186px);
    }
    

提交回复
热议问题