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

查看:25114
本文介绍了资源解释为样式表,但转换为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,choosen和jquery-gentleselect(以相同方式导入索引的其他CSS文件工作正常,没有错误)。我已经检查了我的MIME类型和文本/ CSS已经在CSS上。

The files affected by this error are just the Style, choosen 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).

推荐答案


我想先了解问题

i'd like to start by understanding the problem

浏览器向服务器发出HTTP请求。然后服务器发出一个HTTP响应。

Browsers make HTTP requests to servers. The server then makes an HTTP response.

请求和响应都包含一堆标题和一些内容(有时是可选的)。

Both requests and responses consist of a bunch of headers and a (sometimes optional) body with some content in it.

如果有一个body,那么其中一个头是 Content-Type ,它描述了body是什么HTML文档?图像?表单提交的内容?等)

If there is a body, then one of the headers is the Content-Type which describes what the body is (is it an HTML document? An image? The contents of a form submission? etc).

当您要求您的样式表时,您的服务器告诉浏览器它是一个HTML文档( Content-Type:text / css ),而不是样式表( Content-Type:text / html / p>

When you ask for your stylesheet, your server is telling the browser that it is an HTML document (Content-Type: text/html) instead of a stylesheet (Content-Type: text/css).


我已经检查过我的myme.type和text / css已经在css。

I've already checked my myme.type and text/css is already on css.

然后,你的服务器的其他东西使得样式表带有错误的内容类型。

Then something else about your server is making that stylesheet come with the wrong content type.

浏览器的开发者工具来检查请求和响应。

Use the Net tab of your browser's developer tools to examine the request and the response.

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

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