Skip navigation
Currently Being Moderated

Stretch background image

Jun 22, 2012 12:58 PM

I have a background image for my website that is simply a fade from purple to white. However Dreamweaver wants to either repeat the image or put it in a little box. I want to stretch it out over the background. How do I do this?

 
Replies
  • Currently Being Moderated
    Jun 22, 2012 1:13 PM   in reply to Torkuda1234

    By default, background images don't resize to fill viewport.  They are whatever size you created them in your graphics editor and repeated vertically & horizontally to fill the viewport.

     

    Non-repeating background CSS:

     

    body {

    background-image: url(your-BG.jpg);

    background-repeat:no-repeat;

    }

     

    Repeat horizontally but not vertically:

     

    body {

    background-image: url(your-BG.jpg);

    background-repeat:repeat-x;

    }

     

    Repeat vertically but not horizontally:

     

    body {

    background-image: url(your-BG.jpg);

    background-repeat:repeat-y;

    }

     

     

    Nancy O.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points