【发布时间】:2011-09-15 05:31:12
【问题描述】:
我的安装中的一个 css 文件收到以下警告:
Resource interpreted as Image but transferred with MIME type text/css.
如何解决这个问题? 我在 Rails 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
但是,浏览器仍然声称“资源被解释为图像”。
【问题讨论】:
-
你是如何嵌入 CSS 的?
-
这个问题/答案可以是:stackoverflow.com/questions/658238/… 那里有几个选项。我最喜欢的是 导致类似的事情...我怀疑您的问题出在 HTML 上,因此您可能希望将其发布到生成该警告消息的页面
-
那么,您检查文件是否真的是图像?