relative path not working for images in css
Posted
by vagu
on Stack Overflow
See other posts from Stack Overflow
or by vagu
Published on 2010-05-20T13:16:24Z
Indexed on
2010/05/20
13:20 UTC
Read the original article
Hit count: 197
Hi,
I have the following file structure:
C:/wamp/myproject/admin/webroot/images
I have an index.php file lying inside the admin folder which calls a header.inc.php file lying in the same folder. header.inc.php has the following code-
<td align="left" valign="top" class="header-bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
index.php calls a css file (css.css) through the following code:
<link href="<?php echo (WS_DIR_CSS); ?>/css.css" rel="stylesheet" type="text/css" />
The css lies in the following location:
C:/wamp/myproject/admin/webroot/css
The css files has a class which has the following code:
.header-bg {
background:url(../images/header_bg.jpg) left top repeat-x;
height:77px;
}
The image header_bg.jpg is not being displayed in the browser. Help anyone?
© Stack Overflow or respective owner