Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2010, 04:05 PM   PM User | #1
abourne
New to the CF scene

 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
abourne is an unknown quantity at this point
Need CSS Help

Here is the website in question:

www.searchingforthereal.com

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;
z-index: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.
abourne is offline   Reply With Quote
Old 12-15-2010, 06:30 PM   PM User | #2
cirkut
New to the CF scene

 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
cirkut is an unknown quantity at this point
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%;"
cirkut is offline   Reply With Quote
Old 12-15-2010, 09:14 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
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.
Download the whole thing in a .zip here.


And credit where it's due since it's not my jQuery - http://johnpatrickgiven.com/jquery/background-resize/
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:24 PM.


Advertisement
Log in to turn off these ads.