Image leaves empty block when placed over large background image
Hi, this is the code I put in, but image just wont display. only empty block. The bacground image displays, Im using a pattern background instead of a colour.
The relative URLs in your <img> tags are malformed. There's no valid reason to have double slashes ('//') in a relative URL. And the href in the first <img> tag doesn't have a file name extension. It's difficult to suggest a correction without knowing more about the files involved.
I'd suggest that you find an online tutorial on relative URLs. You'll find your work much easier when you really understand them.
Last edited by rtrethewey; 11-04-2012 at 11:48 AM.
Also you are setting a background image in your body (your body declaration in your css is also wrong) and #img tags and then loading the same images again in the HTML. If they are background images, leave them in your CSS and don't reference them in your HTML, otherwise remove the image sources from your CSS and load them in your HTML. From what you have put, I would say you need:
In your CSS
Code:
body {
background: url('spencer/Pictures/background2.jpg') no-repeat center center;
}
#img1 {
position: absolute;
left: 5px;
top: 20px;
}
thanks, will try that, Been trying all day, everything works, but the actual image wont display still.
My code today- body:{background-image:url ("spencer/Pictures/background2.jpg");position:absolute;z-index:-2)}
#img1 {(spencer/Pictures/headingbanner1.gif");display:block;position:absolute;left:50px;top:20px;z-index:1;width:1000px;height:250px;border:3px solid #444;padding:4px};
Is the CSS embedded in the document or is it taken from an external stylesheet file? The URIs in your CSS and HTML seem to point to the same directory. If you're using an external stylesheet, does it reside in the same directory as your HTML document? If so, then the URI's for the images should use the same relative URLs. URLs in CSS are relative to the CSS file, not the parent HTML document.
Why are you setting the z-index of the <body> to -2?
Bookmarks