【发布时间】:2010-05-21 08:46:27
【问题描述】:
我正在尝试创建一个非常简单的页面,其中包含一个容器、一个页眉、一个左列和一个页脚:
<containter>
<header />
<content />
<leftBar />
<footer />
</containter>
我想使用 100% 的高度,就像我可以使用宽度一样,但我只是 dont get it work.At his moment I'm using min-height, but how could I use the height:100%` ?我喜欢的是页脚始终可见,并且您可以滚动内容。
当前 CSS
body
{
font-family: Verdana;
font-size: 0.8em;
background-color:#f1f1f1;
}
#container {
border:solid 2px Black;
position:absolute;
left:10%;
width:80%;
margin:auto;
}
#header {
height:20px;
background: #DDDDDD;
}
#leftBar {
width: 20%;
background: #669966;
min-height:600px;
postion:absolute;
top:20px;
bottom:20px;
}
#content {
float:right;
background-color: #cdcde6;
position:absolute;
left:20%;
right:0px;
bottom:20px;
top:20px;
padding:5px;
}
#footer {
position:absolute;
height:20px;
}
【问题讨论】:
-
要粘贴代码,您需要将 all 行缩进 4 个空格,而不仅仅是第一行 - 您可以通过突出显示代码块轻松做到这一点然后点击输入框上方的小“101010”按钮(它在图片的左侧和引号的右侧)。
-
谢谢!下次我会记住的,也感谢编辑。