Tuesday, 10 April 2012

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

I was working on a web application and one of my CSS files was not loading in Firefox (ESR 10.0.2 and 3.6). Using Firebug I could see I was getting this error:

[my css file].css was not loaded because its MIME type, "text/html", is not "text/css"

A Google search will say this is either an issue with labelling the type or a server issue. For me the problem was with the DOCTYPE in my JSP. If I remove the line "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" from the page, Firefox is less strict and the CSS will be loaded, but with a warning from Firebug (which I choose to ignore).

No comments:

Post a Comment