通过position:fixed;固定页脚

html:<div class="footer">footer content</div>

css:  .footer{

      bottom:0;

      left:0;

      position:fixed;

      right:0;

    }

注意如何设置“left”“right”两个盒子位移,这使得页脚跨越了页面的整个宽度,而不需使用marginborderpadding来破坏盒模形就做了收缩自如。

 

原文地址:https://www.cnblogs.com/tengzhouboy/p/2969331.html