ThomasJSmart
Programmer
- Sep 16, 2002
- 634
i could make this with a table in about half a minute, but i decided to take the difficult (but correct) route and do it with divs, which ofcourse are not cooperating ^_^
i have a holder
inside this holder is a header
under the header are 3 columns
i would like the holder height to be the same as the hightst column height, wich could be any three (dynamic)
my current setup is something like this:
now this gives me the structure i want except that the holder is only a few pixels high because all the content is positioned absolute.
i tried to set the height of the holder to 100%, this worked great untill the content became bigger than the screen and it seemed the holder stopped where the screen ended leaving a big gap if i scrolled down.
i tried to set the positioning of the columns to relative. but it only worked if i set only 1 of them to relative, but as i dont know which one is going to be longest this didnt work either...
so what now?
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
i have a holder
inside this holder is a header
under the header are 3 columns
i would like the holder height to be the same as the hightst column height, wich could be any three (dynamic)
my current setup is something like this:
Code:
//html-----------------------
<div id="holder">
<div id="header"></div>
<div id="col1"></div>
<div id="col2"></div>
<div id="col3"></div>
</div>
//css-----------------------
#holder{
width:900px;
position relative:
margin-left:auto;
margin-right:auto
}
#header{
width:900px;
height:150px;
position: absolute;
top:20px; left:0px;
}
#col1{
width:160px;
position:absolute;
left:20px; top:0px;
}
#col2{
width:560px;
position:absolute;
left:200px; top:0px;
}
#col3{
width:160px;
position:absolute;
left:780px; top:0px;
}
now this gives me the structure i want except that the holder is only a few pixels high because all the content is positioned absolute.
i tried to set the height of the holder to 100%, this worked great untill the content became bigger than the screen and it seemed the holder stopped where the screen ended leaving a big gap if i scrolled down.
i tried to set the positioning of the columns to relative. but it only worked if i set only 1 of them to relative, but as i dont know which one is going to be longest this didnt work either...
so what now?
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!