webmaster2 Posted July 4, 2004 Share Posted July 4, 2004 Hey all, I am trying to change the background color with an image. How do I write the php code for that? I do know how to do that in HTML: <img scr="...etc etc"></img> , I tried editting the stylesheet the same way but it's not working. I saw a post of this before when someone explained how to do it, but I cannot seem to find that particular post anymore. Can please anyone help! Thanx in advance and have a great 4th of July! "Sometimes doing the right thing isn't doing the right thing" Link to comment Share on other sites More sharing options...
Guest Posted July 4, 2004 Share Posted July 4, 2004 Add this in your stylesheet.css background-image: url(images/your iamge.gif); The_Bear Link to comment Share on other sites More sharing options...
BearHeart Posted July 12, 2004 Share Posted July 12, 2004 Tried this, it isnt working. here is my stylesheet entry: BODY { background-image: url(images/category_hardware.gif); background: #ffffff color: #000000; margin: 0px; } I just used a pic that is already in the file to test it. I've tried it with the color line in and without. the color ref sets the color fine, but n o pic in background. Any thoughts? Link to comment Share on other sites More sharing options...
Guest Posted July 12, 2004 Share Posted July 12, 2004 There is a tutorial here The_Bear Link to comment Share on other sites More sharing options...
burt Posted July 12, 2004 Share Posted July 12, 2004 Missing semi-colon ; after the #ffffff BODY { ?background-image: url(images/category_hardware.gif); ?background: #ffffff; ?color: #000000; ?margin: 0px; } However, this is cascading style sheets. Try: BODY { ?background: #ffffff; ?background-image: url(images/category_hardware.gif); ?color: #000000; ?margin: 0px; } So you are setting white, and then allowing style to cascade to the image background. Or in other words, the image lies on top of the white background that you already set. Link to comment Share on other sites More sharing options...
BearHeart Posted July 12, 2004 Share Posted July 12, 2004 Thanks for that Burt.....as I kick myself in the head for missing the absolutely obvious. Works fine now. Link to comment Share on other sites More sharing options...
burt Posted July 12, 2004 Share Posted July 12, 2004 No problem. The most diffcult problems to overcome are those that stare you in the face, blatantly tripping you up. <-- Can you tell I have had my fair share of head>>keyboard moments? :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.