No Background image |
No Background image |
gimpguy2000 |
Nov 10 2007, 03:19 AM
Post
#1
|
Novice Group: Members Posts: 25 Joined: 10-November 07 Member No.: 4,279 |
Hello everyone,
I had a question that is boggling my mind. I have a basic HTML page, I have images for the heading and such, no problem and these are all in the specific folder like they should be. So when I do <img src="yaddayadda.jpg"</img>, they work just fine. Now, I wanted my background not just colored but add an image. I have done this other times BTW. So I have <body bgcolor="mypic.jpg"> </body> Now, the pic is in the folder and the path is dead on but the background is white and will not display an image. I tried .jpg, .gif, even png <I know, it was just for the sake of it. I am using Firefox in Ubuntu but never had this trouble before. It's 2.0.0.8. Also, I have no CSS implemented yet. Still learning that. I don't recall if there is a size regulation for background images, or if transparency is an issue, etc... Any thoughts would be greatly appreciated. Paul |
pandy |
Nov 10 2007, 03:31 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Hi!
Try this. HTML <body background="mypic.jpg"> http://htmlhelp.com/reference/html40/html/body.html You may also want to look into CSS. It offers better ways to add backgrounds and colors (and much more). http://htmlhelp.com/reference/css/ |
gimpguy2000 |
Nov 10 2007, 03:43 AM
Post
#3
|
Novice Group: Members Posts: 25 Joined: 10-November 07 Member No.: 4,279 |
Hi! Try this. HTML <body background="mypic.jpg"> http://htmlhelp.com/reference/html40/html/body.html You may also want to look into CSS. It offers better ways to add backgrounds and colors (and much more). http://htmlhelp.com/reference/css/ Hi Pandy, Thank you for the reply. It seems when you bother others is right when you figure something out. I moved the pic from the web folder that stores my HTML images and put the background image in the same as the HTML and it works. What I have is a folder eg "Web" and withing "Web", I have my HTML document and another folder "Webimages" where I store the needed images for the HTML. Now, the background image would not work until I pulled it out of "Webimages" and left it *still in Web* but out next to HTML. I haven't had this happen before although I admit, I am no specialist at HTML so forgive me if I state something, well ..dumb. Is there a reason for this? Also thanks for the links and I will be looking into them. I tried a quick CSS earlier and had it linked to an external CSS document in the same folder, but it would work for so long and then act as if the link broke and wouldn't work anymore. So I seem to have quite a bit of work to do yet. Thank you very much, Paul |
pandy |
Nov 10 2007, 05:36 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Sorry, I didn't read your question properly. If you have images in their own folder, the URL in background="" must reflect that. As you have it, the browser looks for the image in the same folder as the the HTML file is in. See here how to do write relative URLs..
http://htmlhelp.com/faq/html/basics.html#relative-url The reason I didn't read was that you had used the wrong attribute in the body tag, bgcolor instead of background So I assumed that was the problem. Maybe you only typed it wrong in your post since it works now. |
gimpguy2000 |
Nov 10 2007, 12:09 PM
Post
#5
|
Novice Group: Members Posts: 25 Joined: 10-November 07 Member No.: 4,279 |
Sorry, I didn't read your question properly. If you have images in their own folder, the URL in background="" must reflect that. As you have it, the browser looks for the image in the same folder as the the HTML file is in. See here how to do write relative URLs.. http://htmlhelp.com/faq/html/basics.html#relative-url The reason I didn't read was that you had used the wrong attribute in the body tag, bgcolor instead of background So I assumed that was the problem. Maybe you only typed it wrong in your post since it works now. Sorry, yes that was one of the many things I tried but only put as example the "bgcolor", some Googling turned up to try this as a troubleshooting method if background didn't work, my apologies. So yes, if I put the background picture in the folder with the other images, it's the only one the URL won't work with and I have tried other images as well. If I take it out of the folder and leave it in the containing folder with the HTML doc, it will work then. I did use the right pathing and URL but it only works being contained in one path regardless. I'll include a screenshot of the setup... the backy.gif will only work if out of the grap folder. .. I know, very weird names but I do a lot of graphics work and have so many names, I try something different for the sake of my own confusion Thanks again, Paul This post has been edited by gimpguy2000: Nov 10 2007, 12:11 PM Attached image(s) |
Darin McGrew |
Nov 10 2007, 01:01 PM
Post
#6
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
If the image stopped displaying when you moved it to a different folder, then you must have gotten something wrong with the path. But unless you post the URL (address) of a document that demonstrates the problem, we won't be able to help figure out what is wrong.
In the meantime, see the FAQ entry Why are my images coming out all wrong or not loading? |
gimpguy2000 |
Nov 10 2007, 07:03 PM
Post
#7
|
Novice Group: Members Posts: 25 Joined: 10-November 07 Member No.: 4,279 |
If the image stopped displaying when you moved it to a different folder, then you must have gotten something wrong with the path. But unless you post the URL (address) of a document that demonstrates the problem, we won't be able to help figure out what is wrong. In the meantime, see the FAQ entry Why are my images coming out all wrong or not loading? Hi , thanks for the reply. The path I use when in the folder above is <body background="grap/backy.gif"> """which didn't work""" When not in the folder as shown above, I use <body background="backy.gif"> and it works. Now, my other images in the folder that I display work with <img src="grap/whatever.gif"</img> So that tells me the path must be valid if other images work. The problem is only with the background body image, if I move it to the grap folder, even with the correct path , it will not work. NOW, here is the kicker, If I <img src> the same image, it works and displays from the grap folder. BUT if I use it as background, nope. As above, I moved it into the same path as the HTML doc. Thanks, Paul This post has been edited by gimpguy2000: Nov 10 2007, 07:05 PM |
gimpguy2000 |
Nov 11 2007, 12:23 AM
Post
#8
|
Novice Group: Members Posts: 25 Joined: 10-November 07 Member No.: 4,279 |
FIXED.
Well, I think there was just one of those unexplainable gliches. I copied all the files, deleted the original, now it works So just some bug it decided to keep with it. Thank you for the help. Paul |
Lo-Fi Version | Time is now: 25th April 2024 - 01:23 AM |