这是asp.net中的一个CSS问题。
我有一个被容器div包围的页面。其中包含div#contenthome
,其中包含div#flashhome
。#Container
和#contenthome
height属性设置为自动。但是当我增加#flashhome
高度时,#container
和#contenthome
高度不会相应改变。如何根据#container
高度自动增加和减少#contenthome
和#flashhome
高度。
#container {
width: 750px;
height: auto;
margin-left: auto;
margin-right: auto;
position: relative;
border:1px;
border-color: #b7b7b7;
border-style: solid;
}
#contentHome {
width: 750px;
height: auto;
position: relative;
display: block;
overflow: hidden;
}
#flashHome {
float: left;
display: block;
width:485px;
height: 255px;
margin-left: 15px;
margin-top: 5px;
}
最佳答案
你应该有一个带有clear的div:都在div flash之后-
<div id="flashHome">
......
</div>
<div style="clear:both"></div>