<style>
html,
body {
margin:0;
padding:0;
height:100%;
}
#container {
min-height:100%;
position:relative;
}
#header {
background:#ff0;
padding:10px;
}
#body {
padding:10px;
padding-bottom:60px; /* 下内边距大小与底部高度一致 */
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:60px; /* 底部高度 */
background:#6cf;
}
</style>
<div id="container">
<div id="header">
<div id="body">
<div id="footer">
</div>
效果