我尝试了所有粘性页脚CCS示例。他们都工作得很好。但是,我有一个问题。假设我有这样的:在粘性页脚上,如何使div边界延伸到页尾到页尾?
<div id="wrap">
<div id="bodyleft">left</div>
<div id="bodyright">right</div>
<div id="footer">footer</div>
</div>
所以,如果我有height 100%
为#bodyleft
,边框不会扩展到视年底到页脚。它只会涵盖一行内容。
无论是一行还是十行,我都希望边界延伸到页面的末尾。
任何想法?
谢谢!
玛丽亚
编辑:
<body>
<div id="wrap">
<div id="bodyleft">on left</div>
<div id="bodyright">
some text on right<br />
</div>
</div>
<div id="footer">footer </div>
</body>
</html>
* { margin:0px; padding:0px; }
html, body {height: 100%;}
#wrap {min-height: 100%;}
#footer {
position: fixed;
bottom: 0;
background-color: #f00;
height: 20px;
width: 100%;
margin-top:-20px; /* negative value of footer height */
}
#bodyleft{
width:222px;
float:left;
border:1px solid black;
overflow:auto;
padding-bottom:20px;
}
#bodyright{
width:777px;
float:right;
border:1px solid black;
overflow:auto;
padding-bottom:20px;
}
亚伦,谢谢你。我已经使用所有可用的变化,高度,最小高度,高度自动,高度100%..没有任何东西可以扩展div的边框 – MariaKeys 2010-08-19 23:23:57