Forum Moderators: not2easy

Message Too Old, No Replies

Can't stop background-repeat

either or

         

txbakers

3:09 pm on Dec 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BODY {
background-image: url(../images/bg.gif) ;
background-repeat:no-repeat;
margin:0;

}

Without the second line the image shows and repeats.

With the second line, the image doesn't show at all!

What am I doing wrong here?

Thanks.

Fotiman

3:46 pm on Dec 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Could it be that the image is shown, but covered by something else on the page? I would try explicitly specifying the background position. Here's the part on the spec regarding background properties:
[w3.org...]

Try this:
body {
background-image: url(../images/bg.gif);
background-repeat:no-repeat;
background-position: left top;
margin:0;
}

You might consider condensing that down to:

body {
background: url(../images/bg.gif) no-repeat left top;
margin:0;
}

penders

9:10 pm on Dec 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is the size of your "bg.gif"?