Forum Moderators: open
I have read that to do this you need to make all tags starting with the main one <HTML> to have height 100% because otherwise it won't work.
Basically
HTML
{
HEIGHT: 100%
}BODY
{
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
PADDING-TOP: 0px;
BACKGROUND-POSITION: left top;
MARGIN: 0px 0px 10px;
FONT: 11px Verdana, sans-serif;
HEIGHT: 100%;
BACKGROUND-REPEAT: no-repeat
}
And so forth. The problem is that in some cases, for example a table right under the body tag, making height=100% will create unnecessary scroll bars and the user will have a scroll bar to scroll down to nothing.
I noticed that for example just setting height=97% on the body tag is enough to remove the scroll bar on the main page while a table with height=100% has to be reduced to much lower number (About 75%) to remove the scroll bar.
Can anybody help me up with what might be causing the scroll bars? I thought it might be the long background but after making it smaller so that it fits entirely on the screen it still shows the bars.
BODY
{
PADDING: 0;
BACKGROUND: #666666 url(images/background.jpg) no-repeat top left;
MARGIN: 0 0 10px 0;
FONT: 11px Verdana, sans-serif;
}
Regards.
Chris.
Imagine a page divided by 2 frames where the left frame is a menu and the right frame is data.
On the right side I have the div which I am trying to set the color but I want the color to span vertically to cover the entire visible space of the page (So if users have different resolutions on their screen the right "frame" will always be filled with a background color) but the problem is that as soon as I tell that the div that sets the color to have a height of 100% it grows over the page size and adds a scroll bar (Even though the menu to the right is much smaller than the screen height).
Hope that makes some sense. Still beating myself around it to try and get it to work.
Open you favourite image editor and make a new document the width of your right div (for the example below, 600px) and 5 pixels in height. Make it a solid colour, the colour you want your background to be.
Then put the 2 divs into a containing div.
The CSS.
html, body { height: 100%; }
#container { height: 100%; padding: 0px; width: 900px; background: url(images/background.gif) repeat-y top right; }
.divLeft { float: left; width: 300px; }
.div right { float: right; width: 595px; }
<div id="wrapper">
<div class="divLeft"></div>
<div class="divRight"></div>
</div>
This works well in all browsers.
Regards.