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

Recently I ran into an issue with FireFox where it indicated that our CSS file was of the wrong MIME type. The error read:

The stylesheet http://dev.somedomainname.com/css/new_design.css was not loaded because its MIME type, "text/html", is not "text/css".

Our first thought was the MIME type in IIS on this server must not be setup correctly. So we checked that out and it was set correctly. It turns out that the issue was with our DOCTYPE.

The DOCTYPE was:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

But by changing the DOCTYPE to transitional, we were able to get it to load and function correctly.

Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

It worked for us. But it is worth noting that even after this change, FireFox and Firebug still displayed a warning about the MIME type.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.