I have a fairly complicated web site that I am updating from tables to CSS. The entire system is dynamic, which makes it even more complicated! Right now, I am trying to make several floated divs fill up their parent container. The content of the first div will always be longer than the others, so I would like the container div to be the same height as the first div inside of it. The trick is, none of the heights can be fixed-- it is all completely dynamic. This is (sort of) what the code looks like right now:
The inner divs are floated dynamically according to their contents (all through ColdFusion and a DB). The width is not a problem, I have that figured out. The individual divs do have classes, but those are determined dynamically as well, and mostly just have to do with background color, etc.
The main problem I am having is that the subTabSection div is not expanding at all, and the inner divs seem to be floating on top of it, rather than within it.
Unfortunately, this is all in development, so I can't provide a URL, but if someone lets me know how to post an image, I could include a screenshot. Thanks for any suggestions!
No, unfortunately it is all still in development on local servers. I was able to make the main div fill the container by using overflow:auto, but the smaller divs only take up as much space as their content does.
To get the smaller divs to fill up the entire container you can use a technique known as "faux columns" or use JavaScript.
The faux columns technique only gives the illusion that the divs fill the height of the container whereas a JavaScript method will re-calculate the required heights for the divs.
A search on "faux columns" or "equal height columns javascript" should produce some useful results.