您正在寻找的是 CSS Sticky Footer 。
* { margin: 0; padding: 0;}html,body { height: 100%;}#wrap { min-height: 100%;}#main { overflow: auto; padding-bottom: 180px; }#footer { position: relative; margin-top: -180px; height: 180px; clear: both; background-color: red;}body:before { content: ""; height: 100%; float: left; width: 0; margin-top: -32767px; }<div id="wrap"> <div id="main"></div></div><div id="footer"></div>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)