I need a little help with image backgrounds

Discussion in 'CSS' started by headlessmunkie, Sep 21, 2006.

  1. #1
    Hi! I've searched all over the internet to find and answer to my question, and it has only confused me further.
    I have made a jpeg image in Photoshop CS2, and uploaded it to photobucket. I have tried countless number of css and html codes so I can set that as my background but there are recurrent problems. First of all, even though I have it as 1024x768, it doesn't seem to fill the entire screen, or with some codes, it gets chopped off at the bottom or on the sides. I read on some forums to change the size to 800x600, but that didn't fix my problem either.
    On a photoshop forum I read that it's best to tile the image so it will fit the screen. The more I searched, the weirder all of this seemed to me.

    I'm sure there's a simple answer to my problem...but I have been looking for hours for the answer...can anyone help me?
    I just want the image to fill the entire screen, not be repeated, and I want it to stay fixed so that when you scroll, the background follows you so it's always the background.
    Does it matter that I tend to use firefox than IE? Or, if one code works for IE, will it not work in firefox, and vice versa? I'm kind of new to html, and all of css is greek to me....but for the love of God...can somebody tell me what I need to do here?

    *headlessmunkie
     
    headlessmunkie, Sep 21, 2006 IP
  2. Fetch Industries

    Fetch Industries Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's not possible to resize an image to fill the screen as a background using CSS only. To use CSS only, you would need to create an image larger than the screen size and allow it to be chopped off. You could set the background image to be position to one of the four corners of the screen to control the chopping of the image.

    You can also us Javascript to resize the background image. See:

    http://www.boutell.com/newfaq/creating/backgroundfill.html
     
    Fetch Industries, Sep 21, 2006 IP
  3. phree_radical

    phree_radical Peon

    Messages:
    563
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What are the problems if you do this?
     
    phree_radical, Sep 25, 2006 IP