Click to See Complete Forum and Search --> : Div Auto Height


aerofanatic
05-19-2009, 03:50 PM
I'm just going to put a simple version of my code here.


<div id="abc">
<div id="def">
<!-- dynamic content here -->
</div>
</div>


#abc
{
width:1024px;
margin:auto;
padding:0px;
background-image: url(../Images/Sat_Home_Mid-Bg.jpg);
background-repeat:repeat-y;
height:700px;
}
#def /* dynamically generated content here */
{
width: 193px;
margin:auto;
padding:0px;
float:left;
}

The problem here is that the abc div does not auto-size and the def div layer ends up floating on top with the abc div not visible. Any ideas?

I think clear:both is supposed to be used somewhere, but I can't seem to be able to figure out where and how.

Thanks for your help in advance.

infinityspiral
05-19-2009, 06:13 PM
You put the clear in after the float- before the last div ending, and after the second-to-last div ending. You can also use:
<br clear="all" />

aerofanatic
05-20-2009, 09:35 AM
Hey, the clear:both; doesn't seem to work when i put it inside the def div css. However, the <br clear="all" /> works.

I need to be using this code for hundreds of pages so can you please tell me why this isn't working?