View Full Version : repeating background image


Chris
05-01-2004, 04:43 PM
Ok, i have a background image that is just at the top of the page.

I want it to repeat across the screen, from left to right.

I have this code in my .css file:

background-image: url(images/bg.png);
background-repeat: repeat-y;

and i have this in my index.html:

<div style="position: absolute; top: 0px; width: 770px; left: 0px;" align=left id=mainimage>
<img src="http://charliedontsurf.xs-host.com/images/bg.png">
</div>

but its not working?? why??

Thanks
Chris

donnamarie
05-01-2004, 04:45 PM
The background should automatically repeat, you shouldn't need a code for it. Could you please give me a URL, so I can see the page, and what is wrong.

Chris
05-01-2004, 05:14 PM
http://charliedontsurf.xs-host.com/index1.html

bourdelson
05-01-2004, 05:20 PM
I see vertical stripes, I don't know if that's what you wanted or not.

Anyway, I looked at your CSS, and maybe I missed it [IE is doing something really weird when I view external style sheets], but I didn't find background-repeat: repeat-y; in there after your background-image part.

Chris
05-01-2004, 05:21 PM
sorry for double posting, but i realised that i works when i delete all the other content on it, so how would i make sure it works when i have other content, and also how to stop it repeating down?

thanks
chris

kittycat
05-01-2004, 06:02 PM
In your CSS you have the word 'body' there two more times than needed. Try removing that and adding the background repeat back in. Although with your background it probably isn't necessary to have that attribute at all.

Chris
05-01-2004, 07:58 PM
its alright, i fixed it, but thanks for all your help!

Chris