页面不够长怎么确保底部一直在屏幕最下方

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html,body {
margin: 0;
padding:0;
height: 100%;
}
#container {
min-height:100%;
height: auto !important;
height: 100%; /*IE6不识别min-height*/
position: relative;
}
#header {
background: #ff0;
padding: 10px;
}


#page {
width: 960px;
margin: 0 auto;
padding-bottom: 60px;/*等于footer的高度*/
}

#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;/*脚部的高度*/
background: #6cf;
clear:both;
}

</style>
</head>
<body>
<div id="container">
<div id="header">Header Section</div>
<div id="page" class="clearfix">


</div>
<div id="footer">Footer Section</div>
</div>
</body>
</html>

  

posted @ 2017-02-10 13:43  鲍攻城  阅读(708)  评论(0编辑  收藏  举报