M
Mark
I am struggling with a CSS2 layout problem, I am using Visual Web Developer
2005 Express.
My website needs to be constrained within the visible viewport. This means
that scrollable content will be contained within a scrollable DIV - the
problem I have is in giving this DIV a certain height and width of it's
containing DIV.
For instance...
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<div id="div1">
<div id="div2">
Hello World!
</div>
</div>
</body>
In my stylesheet I have...
body {
height: 100%;
}
#div1 {
height: 100%;
width: 100%;
background-color: Red;
}
Now the problem is with #div2 - I need it to be set within #div1 with it's
content area say 20px within #div1 - how do I do this? I will have
"overflow: scroll" but I have tried various combinations of using padding
and margin and various position attributes but I have had no luck, can
anybody help?
2005 Express.
My website needs to be constrained within the visible viewport. This means
that scrollable content will be contained within a scrollable DIV - the
problem I have is in giving this DIV a certain height and width of it's
containing DIV.
For instance...
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<div id="div1">
<div id="div2">
Hello World!
</div>
</div>
</body>
In my stylesheet I have...
body {
height: 100%;
}
#div1 {
height: 100%;
width: 100%;
background-color: Red;
}
Now the problem is with #div2 - I need it to be set within #div1 with it's
content area say 20px within #div1 - how do I do this? I will have
"overflow: scroll" but I have tried various combinations of using padding
and margin and various position attributes but I have had no luck, can
anybody help?