标题不言自明,
我希望页脚位于页面底部,但它出现在内容后面。
您可以在此处查看问题:http://inelmo.com (我将页脚设为黑色以便您可以看到)
HTML
<body>
<div id="header"></div>
<div id="wrapper">
<div id="content"> !There is php stuff echoed here! </div>
<div id="sidebar"></div>
<div id="footer"></div>
</div>
</body>
CSS
#wrapper {
width: 902px;
margin: 70px auto 0 auto;
}
#content {
width: 520px;
padding: 15px;
float: left;
}
#footer {
background: #000;
height: 200px;
}
/* Sidebar */
#sidebar {
width: 336px;
float: right;
padding: 16px 0 0 0;
}
最佳答案
将 clear: both;
添加到页脚的样式定义中
#footer {
background: #000;
height: 200px;
clear: both;
}
关于html - 页脚出现在内容后面而不是页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8703374/