• Register
0 votes
346 views

Problem :

I have below problem. Chrome continues to return below error

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

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

How to resolve my error?

7 5 2
3,870 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

I would like to start by understanding a problem

Browsers make the HTTP requests to servers. A server then makes the HTTP response.

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

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

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

I have already checked the MIME.type and text/css is already on a css.

Then something else about the server is making that the stylesheet come with a wrong content type. Use a Net tab of your browser's developer tools to examine your request and your response.

9 7 4
38,600 points
0 votes

Solution:

Browsers creates HTTP requests to servers. The server then creates an HTTP response

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

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

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

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

Then something else regarding your server is creating that stylesheet come with the wrong content type.

Employ the Net tab of your browser's developer tools to test the request and the response.

Employing Angular

The base tag requires to not only be in the head however in the right location.

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

<base href="/">

Add a forward slash / before the path to the css file, like so:

<link rel="stylesheet" href="/css/bootstrap.min.css">
Try this <link rel="stylesheet" type="text/css" href="../##/yourcss.css">

where ## is your folder wherein is your .CSS - file

Don't forget about the: .. (double dots).

reason by lines in my HTML in the following form:

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

The problem was solved at the time I removed rel="stylesheet" from the tag.

10 6 4
31,120 points

Related questions

0 votes
1 answer 8 views
8 views
I have this problem. Chrome continues to return this error
asked Dec 15, 2020 TeamScript 9.6k points
0 votes
1 answer 2.1K views
2.1K views
Problem : Chrome is not redirecting, nor it is changing my previous page, it is just report the below warning in my console: &ldquo;Resource interpreted as Document but transferred with MIME type application/zip.&rdquo; The above process works correctly in my Firefox, and also it works ... the http://0.0.0.0:xxxx/files/download.zip. Am I doing anything wrong here, or is this the bug with Chrome?
asked Jan 4, 2020 alecxe 7.5k points
1 vote
1 answer 85 views
85 views
Problem : With the Chrome 12.0.742.112, if I redirect then the Chrome will not redirect, nor it will change your previous page, it will just report with the below warning in your console: Resource interpreted as Document but transferred with MIME type application/zip. The process ... the http://0.0.0.0:3000/files/download.zip. Am I doing something wrong here, or is this the problem with Chrome?
asked Dec 28, 2019 alecxe 7.5k points
0 votes
1 answer 131 views
131 views
Problem : I have the javascript application and when I try to run it on firefox I am facing the below error on the console: &ldquo;Because its mime type ('text/html') is not a supported stylesheet mime type&rdquo; Now I am completely confused because of this error. Kindly somebody let me know how can I resolve my above error?
asked Jan 29, 2020 jwilliam 3.9k points
0 votes
1 answer 93 views
93 views
Problem : I have the below snippet, which currently using the jQuery Form plugin to post the form to the server in the Ajax. var myoptions = { dataType: "json", success: function(data) { alert("My success"); } }; $form.ajaxSubmit(myoptions); My Ajax implementation is ... /json in the Chrome Developer Tools. I want to really find out why the warning is shown, or find a way to quickly resolve it.
asked Dec 28, 2019 alecxe 7.5k points
0 votes
0 answers 24 views
0 votes
1 answer 386 views
386 views
Problem : I am unable to solve my link problem. Can anybody help on to this to link the CSS and JS File? I am facing below error : Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/ ... .js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/RetailSmart/jsp/Jquery/prettify.js
asked Jan 10, 2020 alecxe 7.5k points
0 votes
1 answer 187 views
187 views
Problem: I am new and learning, I need help, can anyone help by filling in the blanks? When CSS is coded in the body of the web page as an attribute of an HTML tag it is called _____?
asked Feb 21, 2020 maddi86 5.4k points
0 votes
1 answer 11 views
11 views
Question Hi there, I am a new student of HTML and CSS. I am learning all these new things about headings, titles, bodys and how to change colors and stuff which is going well. I'm not really sure how to put my question, but how should I format the code itself to be the most readable? Is there conventions to things like indentations and headings?
asked Oct 8, 2020 jacepairask 120 points
0 votes
1 answer 66 views
66 views
Problem: Which CSS property configures the size of text? A. size B. font-size C. text-size D. font-weight
asked Jul 23, 2020 ArifulIslam 5.6k points