How to stretch small background image full screen

Discussion in 'CSS' started by mk484, Dec 5, 2009.

  1. #1
    Can someone please provide me with the CSS code for the following functions?

    What CSS code do I use to replace the white background on the home page with an image AND adjust the image so it is centered and looks good on all monitor screen sizes? What I want to do is use a smaller image for the background if possible, and stretch it to fit any screen size. If not, I will just use a large image. (and what code do I replace in my current CSS file?)

    ALSO-If you have MySpace profile Layout, or phpfox experience, I need to know what CSS code is used to replace the "Background Main" color with an image, in the member profile. (I plane to use a semi-transparent image)

    Thanks in advance folks. I really appreciate any help.

    EXTRA CREDIT POINTS-if you know how to make my background image change with each new page refresh.
     
    mk484, Dec 5, 2009 IP
  2. vinpkl

    vinpkl Active Member

    Messages:
    899
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #2
    you cannot stretch background images with css.

    if you want to center background image then use

    body
    {
    background-image:url('bg.jpg');
    background-repeat:no-repeat;
    background-position:center;
    }

    vineet
     
    vinpkl, Dec 5, 2009 IP
  3. mk484

    mk484 Active Member

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thank you.

    But if it is not done with CSS, then how? I am a bit curious as to how it is done. I have seen background images that have fillled a background, but when I viewed the image alone it was much smaller.
     
    mk484, Dec 6, 2009 IP
  4. vinpkl

    vinpkl Active Member

    Messages:
    899
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #4
    vinpkl, Dec 6, 2009 IP
  5. mk484

    mk484 Active Member

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Very good. Thank you.
     
    mk484, Dec 6, 2009 IP