View Full Version : Need CSS Help

12-15-2010, 05:05 PM
Here is the website in question:


I am fairly new to css and I am having some sizing problems. I am using a photo for the background of this website and along the left hand side I have a .png that I would like to run the entire distance of the background. Now in order to get the background to re-size with the browser properly I have set it up as fallows.

#bg {
min-height: 100%;
min-width: 1300px;
width: 100%;
height: auto%;
position: absolute;
top: 0;
left: 0;

The bar on the left side of the screen is set up like this:

#Layer-2 {
position: absolute;
left: +114px;
top: 0px;
width: 171px;
height: 100%;
z-index: 1;

The problem is that the image will sometimes exceed the size of the browser window. If you scroll when this happens the bottom of the left bar will cut off. It is sizing to the browser window and not the background image.

Any ideas would be greatly appreciated.

12-15-2010, 07:30 PM
So if I have this right, you do not want the browser to be able to scroll? On the image tag/div holding the image, add overflow:hidden;

See if that helps.

Also, take out the % in "height: auto%;"

12-15-2010, 10:14 PM
hello abourne,
A little jQuery will help resize that image and a full-height layout will make your left bar repeat-y no matter the height.

Look at this demo (http://nopeople.com/abourne/).
Download the whole thing in a .zip here (http://nopeople.com/abourne/abourne.zip).

And credit where it's due since it's not my jQuery - http://johnpatrickgiven.com/jquery/background-resize/