This is a CSS question in asp.net.
I have a page which is surrounded by container div. This containsdiv#contenthome
, with div#flashhome
inside it.
#Container
and #contenthome
height property is set to auto. But when I increase #flashhome
height, #container
and #contenthome
height is not changed accordingly. How can I achieve auto increase and decrease of #container
and #contenthome
heights depending on #flashhome
height.
#container 开发者_Python百科{
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;
}
you should had a div with clear:both after the div flashHome -
<div id="flashHome">
......
</div>
<div style="clear:both"></div>
Give the Height as 100% like below:
container
{
width: 750px;
height: 100%;
margin-left: auto;
margin-right: auto;
position: relative;
border:1px;
border-color: #b7b7b7;
border-style: solid;
}
contentHome
{
width: 750px;
height: 100%;
position: relative;
display: block;
overflow: hidden;
}
精彩评论