我在xhtml页面上的页脚有问题...我想将页脚始终放在页面的末尾,在页面的底部,以便当页面内容不足时,页脚将停留在页面底部屏幕,但是当页面长得多时,它将停留在页面最后内容之后的末尾
我该怎么做???
这是我的CSS文件
html {
height:98%;
margin: 0 auto 0 auto;
width:1280px;
padding:2px;
padding-bottom:0px;
}
body {
overflow:auto;
width:100%;
margin: 0 auto 0 auto;
height:100%;
}
#container {
min-height:100%;
height:100%;
margin:0 auto -50px;
}
#box {
min-height:100%;
}
#push {
height:50px;
clear:both;
}
#footer {
height:50px;
clear:both;
position:relative;
bottom:0px;
width:100%;
}
这就是我页面的结构
<html>
<h:head></h:head>
<h:body>
<div id="conatiner">
<div id="box">
<header></header>
<div id="externalborder">
<div id="push"></div>
<div id="footer"></div>
</div>
</div>
</h:body>
</html>
U只需将底部放在0px处,并将位置设置为固定在页脚上。例:
#footer {
position:fixed;
bottom:0px;
}
#container {
padding-bottom:3em;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句