tags:

views:

71

answers:

2

Im trying to make an elastic (em-based) css layout with four columns and a box that spans two columns in the top left corner. The four columns have the same width (say 20em, with 1em of margin) and the top-left box has variable height. (see a pic below)

There is no need to have the four columns of the same height.

How can I do it? I have tried several ways and they don't work.

I want to stay away from css frameworks and -gasp- table based layouts.

alt text

I am thinking of an html structure like this:

<box></box>  
<column1></column1>  
<column2></column2>  
<column3></column3>  
<column4></column4>
+1  A: 

Check these: http://matthewjamestaylor.com/blog/perfect-3-column.htm

Maybe it can give you some ideas. :)

Tor Valamo
Thanks. I could convert that 3col layout into a 4col one, but I am not solving the top-left box problem.
Victor P
look at the 'stacked columns' layout on that page - that may be closer to what you need
Ray
+1  A: 
<html>
<head>
    <style>
        #outer, #left, #right, #top_left, #bottom_left,
        #bottom_left_left, #bottom_left_right, #right_left, #right_right {
            position:absolute;
            top:0;
            right:0;
            bottom:0;
            left:0;
        }
        #outer {position:relative;}
        #left {right:50%;}
        #top_left {position:relative;}
        #bottom_left {position:relative;}
        #bottom_left_left {right:50%;}
        #bottom_left_right {left:50%;}
        #right {left:50%;}
        #right_left {right:50%;}
        #right_right {left:50%;}
    </style>
</head>
<body>
    <div id="outer">
        <div id="left">
            <div id="top_left">Top left</div>
            <div id="bottom_left">
                <div id="bottom_left_left">Bottom left</div>
                <div id="bottom_left_right">Bottom right</div>
            </div>
        </div>
        <div id="right">
            <div id="right_left">Near Right</div>
            <div id="right_right">Far Right</div>
        </div>
    </div>
</body>
</html>
Tor Valamo
Thank you very much, Tor! Greetings from Chile
Victor P
You're very welcome.
Tor Valamo
I posted a follow-on to this question in http://stackoverflow.com/questions/1896857/4-fixed-width-columns-with-top-left-box-spanning-2-columns-centered-how
Victor P