How can I force my footer to stick to the bottom of any page in CSS?

前端 未结 10 1035
谎友^
谎友^ 2020-12-16 10:52

This is my code:

#footer {
   font-size: 10px;
   position:absolute;
   bottom:0;
   background:#ffffff;
}

I\'ve no idea what is wrong with

10条回答
  •  無奈伤痛
    2020-12-16 11:30

    Why not with jquery?

    Put a wrapper div between header and footer and assign min-height property for wrapper with jquery equal with the difference between document height and (header height + footer height).

    
    

提交回复
热议问题