tags:

views:

28

answers:

3

See here for an example: http://www.pwnedgaming.net/content/testcss/.

If you look at the source code, you'll see that the left_column DIV, when set to a large height, makes the page fill the screen correctly, but the DIV that needs this behaviour is page_content. Yet no matter what I do with the page_content DIV, it just causes the page to overflow.

Can anyone offer some suggestions? I've been pulling my hair out. All the online pointers work correctly when you don't have floated divs, but I need the layout to be fluid.

Thanks,

Kai.

A: 

This is because page_content is floated, therefore stopping it from affecting layout (e.g. increasing the height of the parent container). You have three options:

For three stacked columns in a layout as simple as that, I'd strongly recommend the first. Just change all of the float: left; declarations to display: inline-block. They'll still stack sideways like floated boxes. Please note that you may have to tweak the vertical-align on the elements; sometimes they don't all align to the top when this is done.

Delan Azabani
Sweet, many thanks!All I had to do was set the page_content div to display: inline-block. I left the other two divs alone.Cheers mate,Kai.
kaigoh
Does `display:inline-block` work in all browsers?
LeguRi
@Richard - Aparently in all but IE 5, 6 and 7: http://www.quirksmode.org/css/display.html
LeguRi
Yes. Older versions of IE should use a small hack to trigger hasLayout and then take advantage of another bug where inline gets treated by inline-block when a node has layout: `zoom:1;*display:inline;`
Delan Azabani
+2  A: 

Your class "clear_both" doesn't actually have "clear:both" on it. At least when I added that declaration in Firebug, the page-ending graphic jumped down to where you'd expect.

Also, height definitions are generally unreliable in my experience.

spinn
Well spotted, typo on my part. I rectified that, put the source back to how I had it originally and now working perfectly. A**Kai.
kaigoh
+1  A: 

I'm not %100 certain I understand what you're trying to do. I interpret your question as being "Why is div.content the wrong height? Why is div.footer on top of the content of .page_content?"

You can address this by applying an overflow:hidden CSS property to div.content.

LeguRi
That just cuts off all the remaining content. It doesn't even have a scroll bar. I believe the OP wished for the content node to "push" down the footer, but remain at a minimum of 100% for short pages. This can be achieved using a clearfix or using inline-block in place of floats.
Delan Azabani
Since `div.content` doesn't have a `height` property it doesn't cut off. Did you try it?
LeguRi