CSS - Height of 100% minus #px - Header and Footer

后端 未结 5 762
名媛妹妹
名媛妹妹 2020-12-25 12:55

The webpage in question looks like this:

// The Header //
/*            */
/*  CONTENT   */
/*            */
// The footer //

Both the head

5条回答
  •  -上瘾入骨i
    2020-12-25 13:25

    Place a fixed position on the header and the footer and set them to stick to the top of bottom of the window, respectively. Then place a top and bottom padding on the content area of 20px.

    #header{position:fixed;top:0}
    #footer{position:fixed;bottom:0}
    #content{padding:20px 0}
    

提交回复
热议问题