Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Need CSS Help

  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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%;"

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •