.css文件中的相对图像路径是否存在浏览器兼容性问题? [英] Is there a browser compatiblity issue with relative image paths in .css files?

查看:224
本文介绍了.css文件中的相对图像路径是否存在浏览器兼容性问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 .css 文件,相对引用了这样的图片:

I have .css files with relative references to images like this:

BODY
{
    BACKGROUND: url(bg.gif);
}

其中 bg.gif 文件位于与 .css 文件相同的文件夹中。这在我的测试似乎工作正常,但我注意到一些错误,我的日志,表明一些浏览器试图找到 bg.gif 在同一文件夹中的 .css 文件的<$ c> .html 页面,而不是 .css 文件是

where the bg.gif file is located in the same folder as the .css file. This seems to work fine in my testing but I notice some errors in my logs that indicate that some browsers are trying to find bg.gif in the same folder as the .html page that refers to the .css file, not the folder where the .css file is.

这是一个例子 HTTP_USER_AGENT Mozilla /5.0(Windows NT 6.1; WOW64)AppleWebKit / 535.7(KHTML,如Gecko)Chrome / 16.0.912.63 Safari / 535.7

尝试在线搜索,并找到冲突的信息。

I have tried searching this online and find conflicting information.

推荐答案

我从来没有听说过有任何问题...建议绑定将它们与完整的相对路径链接,或者可能将它们放置到图像文件夹中并通过它链接(类似于重置,第二次机会)。

I've never heard of anything having this problem...I'd suggest tying to link them with the full relative path, or perhaps placing them into a images folder and linking through that (sort of like a reset, 2nd chance).

这篇关于.css文件中的相对图像路径是否存在浏览器兼容性问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆