Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The stylesheet was not loaded because its MIME type, "text/html" is not "text/css" [closed]

I have a javascript application and when I run it on firefox I am getting the following erro on the console:

"The stylesheet was not loaded because its MIME type, "text/html" is not "text/css".

DumbStuck!!

EDIT: Note that it tells that "The stylesheet ABCD..." But ABCD is actually an HTML file.

Edit (ANSWER) : Actually I had wrongly put href="", and hence the html file was refenecing itself as the CSS. Mozilla had the similar bug once, and it is from there I got the answer. But everyone's else answers helped me too. Thanks.

like image 938
Suraj Chandran Avatar asked Feb 03 '10 08:02

Suraj Chandran


People also ask

How do I fix MIME type error in HTML?

To Solve MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled ErrorJust make Sure Your File name and the name You are Using in Link Tag Both Are Same. For Example my File name is style.

What is MIME type in CSS?

A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.


2 Answers

In the head section of your html document:

<link rel="stylesheet" type="text/css" href="/path/to/ABCD.css"> 

Your css file should be css only and not contain any markup.

like image 178
tfentonz Avatar answered Sep 21 '22 17:09

tfentonz


Actually I had wrongly put href="", and hence the html file was referencing itself as the CSS. Mozilla had the similar bug once, and I got the answer from there.

like image 30
Suraj Chandran Avatar answered Sep 21 '22 17:09

Suraj Chandran