CSS Is Not Loaded at All in Internet Explorer (Sec7113)

CSS is not loaded at all in Internet Explorer (SEC7113)

The problem here is with an invalid mime-type for the CSS file. It's possible your CSS file is actually being sent down with a mime-type like text/plain instead of text/css. As a result, Internet Explorer prevents the file from loading so as to avoid potential attack vectors.

This problem was most notably seen when people would reference JavaScript files from GitHub, which are served with text/plain mime-types, but inteded to be used as text/javascript in the document.

Ensure that your response headers contain the text/css mime-type and you should be fine. This information is available in the F12 Developer Tools under the Network panel.

Sample Image

Internet Explorer CSS was ignored due to mime type mismatch on local files (no server)

Found out the issue by testing on a few different machines, it turns out if you have a CSS file set to open with a particular program, it will prevent IE from loading, and will give the above error message -_-

Also mitigating the potential problem by including a CDN version of the CSS at the end of the file (the report has to work with and without internet)

IE10 local page won't open CSS

I found it!

It's OK to use the Control Panel "Default Programs / Associate a file type..." to set .css files to be opened by Notetab Light (my favorite general-purpose text editor). However, if you go into Notetab Light itself and choose View, Options, Associations, and add css to the list, this generates the error I've been seeing.

Apparently, this is producing a registry entry that causes IE10 to be unable to open a local CSS file when it's called from an HTML page. IE9 wasn't afflicted by this (I never had a problem before, and I've been using Notetab Light for ages).

External CSS not working in IE11

I know this is an old problem, but I ran into it trying to solve the same problem with my webserver.

IE/Edge was not honouring the css generated by my (custom-built) webserver. The problem was when my webserver returned the css it didn't mark the mime-type as css and IE/Edge reported (hidden in its console output):

SEC7113: CSS was ignored due to mime type mismatch.

Fix was simply to mark the HTML response mime-type as "text/css" and all was OK.
Note that all the other browsers (Firefox, Chrome, Safari, Android) I tried had no problem with the incorrect mime-type, they just got on with it.



Related Topics



Leave a reply



Submit