background-image(CSS) url 路径问题

标签:
杂谈 |
Background Image
Syntax: | background-image: |
---|---|
Possible Values: | | none |
Initial Value: | none |
Applies to: | All elements |
Inherited: | No |
The background-image property sets the background image of an element. For example:
BODY { background-image: url(/images/foo.gif) }
P { background-image: url(http://www.htmlhelp.com/bg.png) }
When a background image is defined, a similar background color should also be defined for those not loading images.
Authors may also use the shorthand background property, which is currently better supported than the background-image property.
======================================================================
自己在使用 background-image 过程中如:.bg_list00 {
}
总是找不到 background-image: url 中的图片,后来摸索出算是一个方法吧:
在jsp页面中使用
链接到这个 css 时就从根目录找起
background-image: url 就直接从该css文件所在路径做为相对路径找起。
http://s1/bmiddle/4b62e4a92d14ef6019d20<wbr>url
如上图目录结构所示,则Css.css文件里 样式 bg_list00 的 background-image应如下定义:
background-image: url(../images/list_bg00.jpg);
}