View Full Version : Overflow:auto without defining height in IE?

06-06-2007, 05:59 PM
Hello everyone,

I have a weird situation.

I have a body Div in which no height can be defined, so it will stretch to the space provided.

It is inbetween a header and footer div.

Part of the CSS I have for it is this:

position: fixed;
top: 157px;
bottom: 51px;
overflow: auto;
width: 100%;
background: #dededb

*(157px being the top banner and 51px being the footer)

This works beautifully in Firefox, as it sees the 51px, the footer, as the bottom and creates a scroller for the body before the footer.

However, in IE, if you don't define a height, bottom:51px does nothing and the content stretches down all the way until the content ends, past the footer, instead of creating a scroller before it.

Is there a fix for this in IE?

06-06-2007, 09:34 PM
Instead of bottom and top have you tried margin-top and margin-bottom?

06-06-2007, 10:20 PM
Yes I have, but it messed up the page even more. Any other ideas? I thought I got it working like half an hour ago, but didn't realize I was in firefox. *Sigh

06-06-2007, 10:31 PM
Can you post your whole code?

edit:// think I got it, try padding
This is what you wanted correct?