Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS在Firefox/IE上不工作-文件路径?_Css - Fatal编程技术网

CSS在Firefox/IE上不工作-文件路径?

CSS在Firefox/IE上不工作-文件路径?,css,Css,我有一个在Chrome和Safari上运行良好的样式表,但在IE和Firefox上看起来很糟糕,好像它无法识别任何代码。我想这可能与我在背景图片的url部分使用的文件路径有关,但我不确定如何修复它-有什么想法吗?代码如下,提前谢谢 示例代码: h4#forensic{background-image:url('~/images/Layout/Headers/header-forensic.jpg');} 为什么在背景图像url中使用“~”?你有没有检查你是否尊重敏感的语法 第一个/表示您给出了

我有一个在Chrome和Safari上运行良好的样式表,但在IE和Firefox上看起来很糟糕,好像它无法识别任何代码。我想这可能与我在背景图片的url部分使用的文件路径有关,但我不确定如何修复它-有什么想法吗?代码如下,提前谢谢

示例代码:

h4#forensic{background-image:url('~/images/Layout/Headers/header-forensic.jpg');}

为什么在背景图像url中使用“~”?你有没有检查你是否尊重敏感的语法

第一个/表示您给出了相对于域的路径。删除它以使用相对于css文件的路径


Sebastien

尝试删除波浪号
~
字符,可能还有第一个斜杠