CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

前端 未结 29 2451
悲哀的现实
悲哀的现实 2020-11-21 23:48

I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I can\'t make sit at the bottom of the page.

I wa

29条回答
  •  无人共我
    2020-11-22 00:18

    A simple method is to make the body 100% of your page, with a min-height of 100% too. This works fine if the height of your footer does not change.

    Give the footer a negative margin-top:

    footer {
        clear: both;
        position: relative;
        height: 200px;
        margin-top: -200px;
    }
    

提交回复
热议问题