vag*_*agu 2 css php apache path relative-path
我有以下文件结构:
C:/wamp/myproject/admin/webroot/images
我有一个index.php文件位于admin文件夹中,该文件调用位于同一文件夹中的header.inc.php文件.header.inc.php具有以下代码 -
<td align="left" valign="top" class="header-bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
Run Code Online (Sandbox Code Playgroud)
index.php通过以下代码调用css文件(css.css):
<link href="<?php echo (WS_DIR_CSS); ?>/css.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
css位于以下位置:
C:/wamp/myproject/admin/webroot/css
css文件有一个类,其中包含以下代码:
.header-bg {
background:url(../images/header_bg.jpg) left top repeat-x;
height:77px;
}
Run Code Online (Sandbox Code Playgroud)
图像header_bg.jpg未在浏览器中显示.帮助任何人?
相对于css包含图像
如果你的形象住在这里......
/images
Run Code Online (Sandbox Code Playgroud)
你的css住在这里......
/somefolder/css/style.css
Run Code Online (Sandbox Code Playgroud)
那么规则就是
background-image:url( ../../images/header_bg.jpg );
Run Code Online (Sandbox Code Playgroud)
你能用firebug检查元素吗?是否存在可能重新路由请求的重写规则?你有图像阅读权限吗?