【问题标题】:resource interpreted as stylesheet but transferred with mime type text plain issue?资源被解释为样式表,但与 mime 类型文本纯问题一起传输?
【发布时间】:2011-11-12 21:50:28
【问题描述】:

我正在使用 Apache 2.2。我的本地主机打开了我的网页,但没有应用 CSS,也没有加载背景图像。我不知道为什么。使用 Chrome 开发人员工具时,我收到以下警告:

resource interpreted as stylesheet but transferred with mime type text plain 
resource interpreted as stylesheet but transferred with mime type text html
resource interpreted as script but transferred with mime type text html
GET http://www.xmweb.com/js/calendar/layout-3d.css 404 (Not Found)
resource interpreted as Image but transferred with mime type text html

我不明白这个问题。是 httpd.conf 文件的问题吗?我试图添加一个 .htaccess 文件,但仍然遇到同样的问题。请帮忙!

【问题讨论】:

    标签: css apache resources


    【解决方案1】:

    如果您的浏览器似乎无法加载 CSS,并且您收到 404(未找到)和带有 404 消息的 HTML 页面。尝试直接通过浏览器加载http://www.xmweb.com/js/calendar/layout-3d.css 并查看页面。

    打开网络服务器的错误日志以查看缺少的内容可能会有所帮助。

    【讨论】:

      【解决方案2】:

      我在样式表上遇到了类似的问题,我通过将这一行添加到 .htaccess 文件中解决了这个问题:

      AddType text/css .css
      

      我会试试这个,并为 javascript 和图像创建相应的条目。

      【讨论】:

        猜你喜欢
        • 2018-11-09
        • 1970-01-01
        • 2018-08-16
        • 2018-01-23
        • 1970-01-01
        • 2015-02-24
        • 1970-01-01
        • 2012-09-20
        • 2015-12-06
        相关资源
        最近更新 更多