Fluid height main body with header and footer

后端 未结 1 387
刺人心
刺人心 2021-01-28 03:55

What I am trying to do is have the header at the top of the page and the footer at the bottom, with the map full up all availiable space in-between. I also want the header and f

1条回答
  •  感情败类
    2021-01-28 04:26

    My answer here may help: Set div block to 100% height

    Simply set the height of the footer and a negative margin on the content:

    #footer { height:100px; }
    #container { margin-bottom:-100px; padding-bottom:100px; }
    

    Here is an example of how you'd include a footer: JSFiddle.

    Do note that this will not work in IE7 due to its usage of box-sizing.

    Edit: You'll also need to add padding to the container as well to prevent container text appearing under the footer. I've fixed the JSFiddle example to include this.

    0 讨论(0)
提交回复
热议问题