Forum Moderators: not2easy

Message Too Old, No Replies

how to get parent block to extend to accomodate child block?

         

sodani

9:37 pm on Sep 17, 2006 (gmt 0)

10+ Year Member



I have a 2 column layout, and I don't know why, but the wrapper cuts off just below the right hand column regardless of whether or not it's shorter than the left hand column. It makes intuitive sense for a parent to extend down as far down as the longest of its constituent blocks. Can someone tell me how to address this? Here's my page:

[edited by: SuzyUK at 9:49 am (utc) on Sep. 18, 2006]
[edit reason] No URLs please per TOS... [/edit]

benihana

10:15 am on Sep 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is the column thats causing problems being floated?

sodani

9:30 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



yes it is. It's being floated to the left.

icantthinkofone

10:00 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



Possibly it's because you need to 'clear the float'. Floated elements are removed from the normal flow causing your condition to occur. It is, in fact, correct behavior although it doesn't happen in IE due to a bug.

Try adding this to your parent div and see what happens: overflow:auto;
There are other methods but we need to see your complete code if it doesn't.

sodani

10:51 pm on Sep 18, 2006 (gmt 0)

10+ Year Member



Actually both left and right columns are floated left. They're both within a parent div. I'm confused why the parent div would automatically extend to accomodate only the right column.

Setek

4:45 am on Sep 19, 2006 (gmt 0)

10+ Year Member



Maybe you have a height (or min-height, or max-height) attached to it :) Try removing some content and seeing if the parent container adjusts to suit - if it doesn't, then you do have a height attached.

You can add a clearing

div
to fix the parent thinking it has no children:

<div style="clear:both;height:1px;overflow:hidden;font-size:0.1em;">&nbsp;</div>

sodani

10:06 pm on Sep 19, 2006 (gmt 0)

10+ Year Member



I definitely don't have a height associated with it. kinda strange. well, at this point it doesn't matter very much to me any more because the woman whom I was working was very rude, so I'm not working with her anymore.