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

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

    Use a blank div with flex-grow:1 to fill unused spaced right before the footer.

    
    
      Any content you want, 
      put it here. Can be wrapped,
      nested, whatever.
    
    
    Always way at the bottom

    Extract the styles to css as needed. This works by setting as display:flex;

提交回复
热议问题