我有一个div包含3列(每个作为div).问题是父div的高度没有随着列的高度而扩展.
以下是有问题的款式:
#content{
background: #fff;
clear: both;
color: #333;
padding: 10px 20px 40px 20px;
overflow: auto;
}
#leftcol {
position:absolute;
float:left;
top:285px;
z-index:100;
background-color:#EEEEEE;
padding:5px;
-moz-border-radius: 10px;
border-radius: 10px;
}
#rightcol {
position: absolute;
right:208px;
top:285px;
width:177px;
background-color:#EEEEEE;
padding:5px;
-moz-border-radius: 10px;
border-radius: 10px;
}
#centercol {
margin-left: 288px;
margin-right:200px;
background-color:#EEEEEE;
padding:5px;
-moz-border-radius: 10px;
border-radius: 10px;
}
Run Code Online (Sandbox Code Playgroud)
我认为这是左右列中的绝对定位,这会让事情搞得一团糟.每个不使用列样式的其他页面都可以正常工作.父div的高度随着其内部的扩展而扩展.
有人可以帮帮我吗?
Jonesy