Page 1 of 1

Need serious CSS help - Float containers

Posted: Wed Dec 13, 2006 6:45 am
by JayBird
Okay, this is doing my head in, i can normally hack around and get they layout to work as i wish, but not this time!!!

Anyway.

Take a look at this layout (simplified).

You see the left and right menu, whenever they expand, i want their container to expand around the floats, which in turn will push the footer down.

Please help before i throw my computer through the window.

Thanks

Posted: Wed Dec 13, 2006 8:47 am
by matthijs
Before you throw your computer out the window, try clear:both on the #footer

Posted: Wed Dec 13, 2006 8:49 am
by JayBird
matthijs wrote:Before you throw your computer out the window, try clear:both on the #footer
Been there, done that, got the T-Shirt :lol:

Posted: Wed Dec 13, 2006 9:07 am
by Skittlewidth
put position: relative in your #container

Edit: oops not working in firefox

Posted: Wed Dec 13, 2006 9:10 am
by JayBird
Nope, no joy :(

Posted: Wed Dec 13, 2006 9:23 am
by Skittlewidth
is this problem by any chance restricted to IE7?

Posted: Wed Dec 13, 2006 9:30 am
by neel_basu
I Think This Would Work
=================
Replace

Code: Select all

<div id="content">
By

Code: Select all

<div id="content" style="width: 425px; height: 447px;">

Posted: Wed Dec 13, 2006 9:59 am
by matthijs
I am sure the problem has been solved already by clearing the floats (as I mentioned). Isn't it JayBird? Or else, what problem do you still have?The solution neel_basu gives works, but is very restrictive, as the content cannot expand anymore if you give it a fixed height (only in IE<=6 but that's a bug).

Posted: Wed Dec 13, 2006 10:14 am
by Skittlewidth
I think the problem is that the pale yellow box doesn't expand down as well in FF, I've tried a few things and I'm stumped, but you're right, the clear:both on the footer does solve that bit.

Posted: Wed Dec 13, 2006 10:31 am
by matthijs
I think the problem is that the pale yellow box doesn't expand down as well in FF
If you want to clear div outer (which has the yello background color) you'll have to clear that one instead of the container.

Posted: Fri Dec 15, 2006 10:35 am
by JayBird
I tried absolutely every trick in the book to get this layout to work as i wanted but it never did.


I had to take a few steps back, and achieve the layout by coming at it from a completely different angle.

Thanks