tags:

views:

16

answers:

2

I can't figure out why the image is not resolving inside the div id="header_container"

everything looks ok, the image is on the server,,, what's the issue here?

http://winteradagency.com/mrw/index.php

any ideas?

thanks

+1  A: 

Background image URL's in a CSS file are relative to the URL of the CSS file itself, not to the URL of the parent HTML page which included the CSS file.

So, to fix your particular problem, change images/logo.jpg to ../images/logo.jpg, otherwise it is trying to lookup the image in styles/images/logo.jpg

BalusC
thanks a million! I should have known that!
Drea
+2  A: 

When you make a CSS url() directive a relative path, it is relative to the CSS file, not the page the CSS is on. In your case, the header_container directive is:

background-image: url(images/logo.jpg);

Because your CSS file is in /mrw/styles/styles.css, the path that the image is being looked for at is /mrw/styles/images/logo.jpg. You need to adjust your CSS directive accordingly. One of the following should work:

background-image: url(/mrw/images/logo.jpg);

or

background-image: url(../images/logo.jpg);
zombat