Resource Interpreted as Stylesheet But Transferred With Mime Type Text/Html (Seems Not Related With Web Server)

Resource interpreted as stylesheet but transferred with MIME type text/html (seems not related with web server)

i'd like to start by understanding the problem

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.

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).

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).

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.

Resource interpreted as Stylesheet but transferred with MIME type text/javascript

I had the exact same problem, cause by lines in my HTML in the following form:

<link rel="stylesheet" type="text/css" href="css/my_css_resource.css" />

The problem was fixed when I removed rel="stylesheet" from the tag.

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

I figured it out. In the main app someone added response.headers["Content-Type"] = 'text/html; CharSet=UTF-8', so IE can’t read the CSS.

And my code in app.py

app = Blueprint("conf_manager",
__name__,
template_folder="templates",
static_folder="static",
static_url_path="/static")

should be changed to:

app = Blueprint("conf_manager",
__name__,
template_folder="templates",
static_folder="static",
static_url_path="/conf_manager/static")

CSS, .htaccess, Resource interpreted as Stylesheet but transferred with MIME type text/html

Use flag T=text/css

RewriteRule (.*)$ index.php?query=$1&search=Pages [QSA,T=text/css]

golang Resource interpreted as Stylesheet but transferred with MIME type text/plain

Your basic problem is very simple: You need Content-Type instead of Content Type.

However, there is a better way to match MIME types to file extensions in Go, specifically the mime standard library package. I would strongly suggest that you use it.

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

Create an .htaccess file into your root folder (or update the existing one) with this line inside

AddType text/css .css 

this will tell apache to send the right content-type header for .css file

Resource interpreted as Stylesheet but transferred with mime

OP forgot to upload his responsive.css, and it wasn't found. Ensure you have uploaded that file to the root folder.

As shown below, you can see if this is happening in the network tab (F12 in firefox or chrome under the developer tools). You can also click on the mystyle.css, and click "Response" to view what was downloaded and ensure you're seeing the correct stylesheet.

Sample Image

If you navigated to the css file, you would see that it goes to your hosting providers 404 error page, instead of the correct .css file.



Related Topics



Leave a reply



Submit