Why doesn't my sticky footer stick?

后端 未结 7 710
甜味超标
甜味超标 2021-01-14 19:34

I\'ve browsed to all question related to \"sticky footer\" and nothing helped me because my #content div does not always have sufficient content to push the footer to the bo

7条回答
  •  我在风中等你
    2021-01-14 20:20

    Going off Harmen, i have tested this and it works, with the footer in the container. altho it is a little hackish

    CSS

    html, body, div#container { height: 100%; }
    body > div#container { height: auto; min-height: 100%; }
    
    div#index_body { 
      min-height: 100%;
      margin-bottom: -46px;
    }
    
    .footer, .push {
      height: 30px;
    }
    
    .footer { 
      clear: both; 
      position: relative; 
      z-index: 10; 
      margin: 0px;
    }
    
    .footer { 
      color: #666;
      background-color:#F4F7FA;
      border-top:1px solid #E6E7E8; 
      font-size:95%;
      text-align: center;  
    
       }    /* END FIX */
    

    html

    
    

提交回复
热议问题