views:

43

answers:

2

Hi - I would like to lay out an area like this:

---- ----
|A | |B |
|  | |  |
---- ----
---------
|C      |
---------

where each of the three boxes is a <fieldset>. Box A and B might be populated by different amounts of items, yet they should both be the same height (the height of the one that needs to be larger).

Box C should be 100% width and right below them.

What is the proper/esaiest HTML/CSS/JS to accomplish this?

EDIT: I forgot to add the possible wrinkle that inside the fieldsets is a "jEditable" such that the fieldset height might change dynamically, and the other fieldset would need to resize too.

+3  A: 
A {
    float:left;
    width:50%;
}

B {
    overflow:auto;
}

C {
    clear:left;
}

Don't know if you want more ?

MatTheCat
@MatTheCat: Thanks, but I don't think that solves the height problem. The one with less content is shorter.
Scott Stafford
Height doesn't necessary is the same to give the impression. So if it is visible you can apply fixed height to A and B.
MatTheCat
I can't set fixed height, it is dynamic....
Scott Stafford
Have these blocks different backgrounds which show their height are not equal ? C will always be below the heighest <div>
MatTheCat
A: 

Rather than using float, I solved it like this:

fieldset.sidebyside
{
    width: 48%;
    display: inline;
    vertical-align: top;
}

using an HTML structure that looked like this

<div class="sidebyside">
    <fieldset class="sidebyside"> ... </fieldset>
    <fieldset class="sidebyside"> ... </fieldset>
</div>

There are a number of approaches to the "equal height" problem, as detailed in this blog post: http://www.ejeliot.com/blog/61.

I was eventually successful using a personalized variant of this specific solution, which uses jQuery to size (and resize) the divs using min-height: http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/

Scott Stafford