How to make CSS URL background images show up in localhost?

Posted by Joel on Stack Overflow See other posts from Stack Overflow or by Joel
Published on 2010-05-17T22:19:59Z Indexed on 2010/05/17 22:30 UTC
Read the original article Hit count: 201

Filed under:
|
|
|

Hi guys, I just installed xampp and I brought one of my live sites into it to be able to start working from localhost.

So to view my site, I navigate to localhost/example.com

I noticed some issues with images when on my html, I had for example:

<img src="/new_pictures/05.jpg" alt="Central Market"/>

Image wouldn't show up, but then I removed the / and this works:

<img src="new_pictures/05.jpg" alt="Central Market"/>

I seem to have a similar problem with the CSS background image, but I can't get it to work-if I remove the / there, the image doesn't show up on the live site. How do I make the background image show up on localhost?

Example CSS (works in live site but not localhost):

.outeremailcontainer {
height:60px;
width: 275px;
background-image:url(/images/feather_email2.jpg);
text-align:center;
float:right;
position:relative;
z-index:1;
}

Thanks!

© Stack Overflow or respective owner

Related posts about localhost

Related posts about css