CSS does not load, Resource interpreted as Stylesheet but transferred with MIME type text / html [closed]

1

Hello everyone, I'm working on an MVC project but I came across a bug in css that had never happened to me. When stacking the CSS the browser returns a render error.

No firefox:

  

12: 08: 16,973 The link style sheet was loaded as CSS, although its MIME type, "text / html" , not "text / css" .1 portfolio

In google chrome:

  

Resource interpreted as Stylesheet but transferred with MIME type text / html:

Does anyone know what it can be?

    
asked by anonymous 21.06.2015 / 17:12

1 answer

1

Browsers request HTTP for servers. The server then returns an HTTP response.

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

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 content of a form submission? >

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 style sheet (Content-Type: text / css).

Use the browser's Network tab to examine the request that is going to the server and its response. From what appears there you will be able to find out where you are placing Content-Type for text / html

    
22.06.2015 / 12:54