Help with inner content box margins/padding
Posted
by Wolfgang
on Stack Overflow
See other posts from Stack Overflow
or by Wolfgang
Published on 2010-03-29T00:38:01Z
Indexed on
2010/03/29
0:43 UTC
Read the original article
Hit count: 551
I am working on a layout for a new site, and I'm having some trouble achieving what I want with the CSS. First of all, I want everything to always stay within the view of the current browser window, with scroll being in my content and not the browser itself. I have an outermost DIV which acts as my "wrapper" for the site displayed centered, with a set width, and having 100% height of the bowser window. Inside of this I place a header and all of this works as intended in all interested browsers.
However, once I place my actual content DIV inside this "wrapper" I am unable to define it to be the size I want. If I simply give it margins or padding to make up for the header I have absolutely positioned, the content will overflow and I can't set scroll. And if I try to set the size directly, there are no values I can put in that will work since the margins/padding will add to the size and it will now be bigger than the current browser window, and overflow.
Are there any styles people can think of I can use on the wrapper/content DIV(s) to get the desired look? Here is a diagram illustrating the look I want.
© Stack Overflow or respective owner