我只是对页脚进行一些快速更改。
页脚需要有粘性,我按照A List Apart描述的方法进行操作尝试让页脚留在底部的方法,但它似乎只偏离了一点点。
html, body {
height: 100%;
}
#container {
position: relative;
min-height: 100%;
}
<div id="container">
<div id="content">...</div>
<div id="footer">...</div>
</div>
最佳答案
我总是使用 CSSStickyFooter method .
HTML,一个基本框架
<div id="wrap"> <div id="main"> </div> </div> <div id="footer"> </div>
CSS,这只是一个片段
* {margin:0;padding:0;} html, body {height: 100%;} #wrap {min-height: 100%;} #main {overflow:auto; padding-bottom: 180px;} /* must be same height as the footer */ #footer {position: relative; margin-top: -180px; /* negative value of footer height */ height: 180px; clear:both;}
关于html - 粘性页脚未放置在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14877482/