• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

background image in a div...

Elderly Newt

Senior member
I want to have a div box have a background image. I'm trying to use background-image.... but no image shows up. Nothing. Not even a red X. This is how it looks:

#header {
background-image: url(header.jpg);
}

The image is in the same directory as the page itself. Why isn't this showing up? Just for kicks, I tried linking it to Google's logo using the full URL... and it worked 😕
 
Try

#header {
background: url(header.jpg) #000;
}


Try some other things:
1. Make sure your CSS is actually working, I usually just add "border: 1px solid #000;"
2. Make sure everything is case sensitive.
3. Download Firebug (a very handy tool for Firefox) and see if you can find anything wrong.
4. Try a different picture?
 
thanks for your help, i found the problem though... i was specifying the image location relative to the html file and not the css file... doh!
 
Yeah, image problems like missing files are tricky in CSS, because the browser doesn't give you any indication what the problem is. Glad you found it.
 
Back
Top