不就是footer 沉底么,我一直用的 //页面布局 html body <div class="page-bg"></div> <footer></footer> body html //不用响应式的话就这样 html,body{ height:100%; } .page-bg{ min-height: 100%; height: auto !important; padding-bottom: 80px; //都是80,自己定义footer高度 } footer{ height:80px; //都是80 margin-top:-80px; //都是80 } //用响应式,那就每个breakpoint下给高度重新设置一下,平板以下基本就不用设置高度了,自动就好,主要看设计
<style> .po{ position:absolute; left:200px; top:300px; width:500px; height:300px; background:#ccc;} </style> <div class="po"></div> 绝对定位?position:absolute;
不就是footer 沉底么,我一直用的