资源被解释为样式表但使用 MIME 类型 text/html 传输(似乎与 Web 服务器无关) [英] Resource interpreted as stylesheet but transferred with MIME type text/html (seems not related with web server)

查看:56
本文介绍了资源被解释为样式表但使用 MIME 类型 text/html 传输(似乎与 Web 服务器无关)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题.Chrome 继续返回此错误

I have this problem. Chrome continues to return this error

资源被解释为样式表但使用 MIME 类型 text/html 传输

Resource interpreted as stylesheet but transferred with MIME type text/html

受此错误影响的文件只是Style、selected和jquery-gentleselect(其他以相同方式导入索引的CSS文件运行良好且无错误).我已经检查了我的 MIME 类型并且 text/css 已经在 CSS 上.

The files affected by this error are just the Style, chosen and jquery-gentleselect (other CSS files that are imported in the index in the same way work well and without error). I've already checked my MIME type and text/css is already on CSS.

老实说,我想从了解问题开始(这似乎是我无法单独完成的).

Honestly I'd like to start by understanding the problem (a thing that seems I cannot do alone).

推荐答案

使用 Angular?

这是一个非常重要的警告,需要记住.

This is a very important caveat to remember.

基础标签不仅需要在头部,还需要在正确的位置.

The base tag needs to not only be in the head but in the right location.

我的基本标签在头部的错误位置,它应该在任何带有 url 请求的标签之前.基本上将它作为标题下方的第二个标签为我解决了这个问题.

I had my base tag in the wrong place in the head, it should come before any tags with url requests. Basically placing it as the second tag underneath the title solved it for me.

<base href="/">

我写了一篇关于它的小帖子这里

I wrote a little post on it here

这篇关于资源被解释为样式表但使用 MIME 类型 text/html 传输(似乎与 Web 服务器无关)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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