100%的股利高度我有一个两分栏布局:没有滚动条
<html>
<head></head>
<body>
<div id="container">
<div id="header"></div>
<div id="sidewrapper"></div>
<div id="contentwrapper"></div>
</div>
</body>
</html>
我想有两个侧边栏和内容100%的高度,但最顶级的容器的最小高度应为100%。
我试着用下面的CSS来解决这个问题:
* {
margin: 0;
padding: 0;
}
html {
font-family: Georgia, serif;
color: #000; height:100%; min-height:100px;
}
body {
background: #fff; height:100%; min-height:100px; overflow:hidden;
}
#header {
width: 100%;
position: relative;
float: left;
height: 23px;
}
#container {
position:relative;
width: 100%; height:100%;
margin: auto; background:blue;
}
#contentwrapper {
float:left;
background:red;
position: relative;
width: 700px; padding:0px; margin:0px;
height: auto;
}
#sidewrapper {
float:left;
position: relative;
width: 159px; height:100%;
padding:0px; margin:0px;
}
...但我得到的,因为头的23像素高度的滚动条。我试图用溢出来解决它:为body元素隐藏,但我不知道这是否是正确的解决方案。
任何想法?
您的演示代码中存在一些错误。我猜#sidewrapper其实是#sidebar,#contentwrapper其实是#content? – Gidon 2010-11-25 08:24:56
对不起,我更新了我的代码 – 2010-11-25 08:30:45