I need help with full paging a background image

Discussion in 'CSS' started by ICE_monky, Jun 10, 2007.

  1. #1
    I'm trying to make a background image full page and adjust to the browser size through CSS. If its not possible, then I need to know what the best way to fit it is. ANY help with this will be GREATFULLY appreciated
     
    ICE_monky, Jun 10, 2007 IP
  2. HypertextFever

    HypertextFever Peon

    Messages:
    158
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Tiling the image is the best approach. I understand not all images can be/should be tiled.

    If you want to get CrAzY then you could create a layout with a background div on layer 1 that includes that image (not as a background image) and set width to 100%. Then, a foreground div (content) on layer 2 or 50 or whatever.
     
    HypertextFever, Jun 10, 2007 IP
  3. ninjamuk

    ninjamuk Peon

    Messages:
    305
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Depending on the image, you might want to use a simple x-repeat or something.

    For example, this page...

    http://www.microsoft.com/en/us/default.aspx

    ...uses a 1-pixel wide image (http://i2.microsoft.com/shared/core/1/images/Stage_BG_btm.png) and repeats it along the x-axis (horizontally). This creates a page-wide, smooth gradient with only a .33K image.

    The CSS for this method usually looks something like this...

    body{
    background-image: url(IMAGE_PATH);
    background-repeat: x-repeat;
    background-color: #ffffff;
    }

    Hope it helps
     
    ninjamuk, Jun 11, 2007 IP
  4. ICE_monky

    ICE_monky Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That would all be helpfull, but the image I'm trying to use can't be tiled. This is it[​IMG]
     
    ICE_monky, Jun 11, 2007 IP
  5. demonhale

    demonhale Peon

    Messages:
    352
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Center the image, cut a small portion on the side and tile it so it blends well with the bg... The not so pretty way is wrapping this inside an image tag and make a percentage width and height which pixelates...
     
    demonhale, Jun 11, 2007 IP
  6. kashif.nazar

    kashif.nazar Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can tile the image to the whole back ground, but it might destroy the image quality., so u need to make the image of the same size of the width and then set it as back ground.
    or just make a big image of resolution 1072 * 1000 and display it according to the background screens.
     
    kashif.nazar, Jun 13, 2007 IP