Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-26-2008, 04:00 PM   PM User | #1
Darkmatter5
New Coder

 
Join Date: May 2008
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
Darkmatter5 is an unknown quantity at this point
Help with div background image

Here's my CSS code
Code:
#header {
    height: 60px;
    border-bottom: 2px solid black;
    background-image: url(images/hdr-bkg.png);
    background-repeat: repeat-x;
    /*background-color: fuchsia;*/
    z-index: 2;
}
In my HTML file I've created the header div, but the image won't show up in FF or IE. The path to the file is correct, what could be causing this?
Darkmatter5 is offline   Reply With Quote
Old 11-26-2008, 04:17 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello Darkmatter5,
Try replacing all those background lines with this:
Code:
background: #000000 url(images/hdr-bkg.png) repeat-x;

Change the #000000 color or remove it, it's only black because I don't know what fucia is.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-26-2008, 04:18 PM   PM User | #3
BoldUlysses
Regular Coder

 
BoldUlysses's Avatar
 
Join Date: Jan 2008
Location: Winston-Salem, NC
Posts: 938
Thanks: 10
Thanked 190 Times in 187 Posts
BoldUlysses is on a distinguished road
Where is your CSS file located relative to the image file, though? If you're linking to an external stylesheet from your HTML file like so:

Code:
<link href="css/main.css" rel="stylesheet" type="text/css"/>
then your CSS file is up one directory level (/css) relative to the HTML file, so in referencing the background image, you'll need to tell the CSS file to go back down one level:

Code:
background-image: url("../images/hdr-bkg.png");
If that doesn't fix it post your whole code (HTML and CSS).
__________________
matt | design | blog
BoldUlysses is offline   Reply With Quote
Old 11-26-2008, 04:51 PM   PM User | #4
Darkmatter5
New Coder

 
Join Date: May 2008
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
Darkmatter5 is an unknown quantity at this point
Both suggestions helped the ../ post fixed the image not showing, but the other post helped consolidate my code. Thanks!!
Darkmatter5 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:16 AM.


Advertisement
Log in to turn off these ads.