通过仍然获得“资源解释为图像但以MIME类型text / css传输的资源”,Content-Type是正确的

问题描述

| 对于安装中的一个CSS文件,我收到以下警告:
Resource interpreted as Image but transferred with MIME type text/css.
如何解决这个问题呢? 我在2.8.11上使用Ruby运行apache2。 服务器肯定在发送正确的内容类型:
Accept-Ranges:bytes
Connection:Keep-Alive
content-encoding:gzip
Content-Length:803
Content-Type:text/css
Date:Wed,15 Jun 2011 04:20:45 GMT
ETag:\"66941-921-49f967c2bd200\"
Keep-Alive:timeout=15,max=96
Last-Modified:Tue,29 Mar 2011 03:16:24 GMT
Server:Apache/2.2.12 (Ubuntu)
vary:Accept-Encoding
但是,浏览器仍声称\“资源被解释为Image \”。     

解决方法

        我遇到了同样的问题,并通过修复我的CSS文件之一解决了该问题。 我更改了代码:
body { background:url(\'\'); }
对于:
body { background-image:none; }
说明: 由于
url(\'\')
指向自身,并且是
.css
文件,因此浏览器找不到它要填充
url
的图像。