tags:

views:

51

answers:

2

It's me again with divs :(. I can't understand this... There is parent-block:

#content
{
position: relative;
width: 92%;
margin: 0 auto;
height: 100%;
min-height: 500px;
border: 1px solid red;
}

And I need in 2 blocks in it:

#news
{
position: relative;
float: left;
min-height: 400px;
width: 290px;
height: 100%;
}
#text
{
position: relative;
float: left;
margin-left: 20px;
min-height: 400px;
width: 625px;
height: 100%;
}

        <div id="content">
            <div id="news">
                ...
            </div>
            <div id="text">
                ...
            </div>
        </div>

But 2nd text block isn't in one line with news. And, after resizing news and text block, content block should resize too, but it doesn't... Why? Here is link to see all this: link text

A: 

You may need to add:

  display:inline;

to the divs.

Also, double check that there is enough space in the parent div. Each browser calculates this differently. That is, for the two divs to appear side by side there must be enough space to account for their widths and margins etc.

Vincent Ramdhanie
+2  A: 

It's because both the divs inside #content are floated, taking them out of the normal document flow. On #content, change height: 100%; to overflow: hidden; - this should make it accomodate the floated elements inside it.

Will Prescott
overflow: hidden; is exactly that, what I need for height and floating divs, but could u look at that page again, now content block has changed it's position, why?
Ockonal
Looks like the relative positioning on your #head_float_layer div is causing this now that #content is properly positioned. Try changing #head_float_layer to this: #head_float_layer { background-image:url(../images/head_layer.png); height:336px; margin:0; padding:0; position:absolute; right:100px; top:0; width:448px; z-index:9999; } You'll need to add as much margin as you need to the top of #text if you don't want the image to overlap so much...
Will Prescott
Thank you very much! I didn't think that trouble is due to head_float_layer. U've solved my problem!
Ockonal