所以我想在页面上粘一个页脚,并让this one为我工作。一切都很好,但不,不是真的..粘滞页脚,或者说:内容不会延伸到页脚
问题是,我希望页脚上方的内容一直向下伸展。现在,包含主要内容的框在框中的文本之后结束,并且在页脚和内容之间存在大的空间。我想要的是深入到页脚的主要内容的背景! 看我美丽的形象!
这就是我现在所拥有的以html:
<div id="wrap">
<!-- start header -->
<div id="header">
<div id="header-content">
</div>
</div>
<!-- end header -->
<!-- start main -->
<div id="main">
<div id="main-content">
</div>
</div>
<!-- end main -->
</div>
<!-- start footer -->
<div id="footer">
</div>
而且在CSS:
html {
height: 100%; }
body {
height: 100%;}
/* wrap */
#wrap {
min-height: 100%; }
/* main */
#main {
background-color: #43145c;
overflow: auto;
padding-bottom: 50px; }
#main-content {
width: 720px;
margin: auto;
background-color: #643280;
padding-top: 20px; }
#footer {
position: relative;
margin-top: -50px;
height: 50px;
clear: both;
background: red; }
我已尝试设置的主要以100%以上的高度,但没没有工作。我只是希望主要内容的背景颜色一直到页脚,因为它与主体和主框不同。
它有什么意义吗?谁能帮忙?
设置主体的最小高度不能算出来,因为它的父母没有高度设置。 – 2012-02-21 21:24:28