CSS not rendered in IE 10 - css

CSS files not rendered in IE 9 and 10 but works good in compatibility mode.
I am the following error get "SEC7113: CSS was ignored due to mime type mismatch" in IE 10 .
wherein i don't get a content-type in my response header!
Further this is on my local.
Any suggestions could be appreciated.

It has an answer, summary would be:
As due to MIME type mismatch css was ignored in IE 9 and 10. The MIME type can be correct by utility called File TypesMan It is freeware created by NirSoft. It turned out that the MIME type of .css had been changed to text/plain, preventing IE from rendering my styles. using FileTypesMan to change it back to text/css fixed the problem.
Download FileTypesMan from the NirSoft site. Use the links near the bottom of the page to select the correct version for your operating system (there are different versions for 32-bit, 64-bit, and Windows 98/ME).
Unzip the files to a local folder, and double-click FileTypesMan.exe.
When FileTypesMan has finished listing all file types, scroll down in the top pane to find .css.
Double-click to edit the settings.
Change the value to text/css in the MIME Type field in the dialog box that opens.
Click OK. Job done.
IE 10 should now behave itself (well, at least as far as rendering style sheets is concerned).
Not my work: Its not my own search, you can see this here: https://stackoverflow.com/a/18791928/1762944
I hope this fixed you!
I was wondering that you are not writing type="text/css" but you said, that you are! So I found this the next helpfull article! It has the same issue as yours. SEC7113: CSS was ignored due to mime type mismatch
I just did a simple Google search for the issue, and this was the first result! You should have searched for the issue.

Please ensure that the CSS file gets delivery with the correct "Content-Type" from the server. It must be "text/css". Use the developer console to determine the current type.
Potentially you need to adjust/create the MIME type mapping (e.g. for httpd).
hth

Try to specify the attribute type="text/css" in your tag. Place your style tag in <head> section.

I was having similar problem with an embedded micro-controller (not a lot of control over the server changing content type). Not sure if this applies but I found going into Settings->Compatibility View Settings and adding the IP (site) address the CSS was accepted and the page rendered properly.

Related

Drupal 7.52: Text editor not appearing anymore

Adding in new content on Drupal 7.52:
After the latest browser updates of Firefox and Chrome the text editor TiNYMCE does not appear anymore. All I see are the text areas. Switching between 'Full HTML' and 'Filtered HTML' does not make a difference.
Everything was working fine on Firefox 49.
Now on version 50 I see this error in the console:
The resource from "[SERVER ADDRESS]/misc/jquery.once.js?v=1.2”
was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
Can anyone help here? I tried to install a different editor, but that did not change anything.
The browser is expecting the MIME type of the file to be set. I'd check the source to make sure the appropriate MIME type is being set for the file. here's a list of MIME types for you: https://www.sitepoint.com/web-foundations/mime-types-complete-list/ -- head down to the .js section and compare it against your source, first checking jquery.once.js.
Also, check this https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options

IE9 standard view no load CSS

I have this problem and maybe I'm not the only..
If I test my website on FF, Chrome, Safari, IE7, IE8 is perfect.
On IE9 (standard view) It doesn't load CSS files. If I switch on Compatibilty view it works fine...
How can I show the CSS on the standard view as well?
Thanks
IE9 is known to reject stylesheets which are not sent using "text/css" MIME type. This is a new security enhancement, but it's catching a few people off guard. Is your CSS file dynamically generated? Make sure its getting passed as 'text/css'.
More info: http://blogs.msdn.com/b/ieinternals/archive/2011/03/27/http-406-not-acceptable-php-ie9-standards-mode-accepts-only-text_2f00_css-for-stylesheets.aspx
Another try:: It's not just 'text/css' in the doc that needs to be correct, you need to make sure your local IIS is sending it with the proper headers. "If a style sheet is ignored due to an incorrect MIME-type, your site may fail to render as expected. Text, images, or other features may lack the desired styling. If a style sheet is ignored because it does not bear the correct MIME-type, a notification will be logged in the IE9 F12 Developer Tools console."
http://msdn.microsoft.com/en-us/library/gg622939%28VS.85%29.aspx
IE9 Not applying linked style sheets
I'm assuming your local web server is running IIS. If so, just map the .css file extension to the "text/css" MIME type. Like this...
In IIS v7.x:
Click "MIME Types". You should see a list of file extensions and the associated MIME type.
There should be an entry for the ".css" extension with MIME type = "text/css".
If not, add it by right-clicking anywhere on the list -> Add... -> type in the ".css" extension and "text/css" MIME type.
In IIS v6:
Right-click the server node -> Properties -> "MIME Types...". You should see a list of file extensions and associated MIME the type.
There should be an entry for the ".css" extension with MIME type = "text/css".
If not, add it by clicking "New..." -> type in the ".css" extension and the "text/css" MIME type.
Likely a typing error in the way you include the stylesheet. Is the URL correct, and is the tag closed properly?
We got this kind of problem with a web project, and the trick was to force IE9 to emulate the website/application
as it was IE8.
To avoid to use IE9's compatibilty mode,put into the code this tag
after the tag like this :
< head>
< meta http-equiv="X-UA-Compatible" content="IE=8">
...
< /head>
be sure to put it as the first tag after <head>, if not it doesn't work
I was also facing the same problem, then I moved my css file to static server(or any other domain) and used the new url.
It worked for me, see if this can solve the problem for you too.
I fixed this issue by setting the encoding at the top of my stylesheet
#charset "UTF-8";

'Open files based on content, not file extension' in IE 9

I am supporting a site for a client on the intranet. The site contains links to xml files. These xml files have a unique extension and are intended to be opened by a specific application. Using IE 8, we could support this by setting the option ‘Open files based on content, not file extension’ in Internet Options -> Security -> Custom Level. In IE 9, this option has been removed. Now these files open a new tab and display the xml.
Ideally, I’d like the file to just download through the download manager, but opening file in the application on the client machine would be acceptable as well. What is the best way to do this in IE 9? Is there a setting that I should adjust? Server side, I have tried adjusting the MIME type, but it seems that if I sent it to something unknown (e.g. application/octet-stream) IE determines the content. The last option I could think of would be to adjust the links such that they call an asp.net page that loads the contents of the xml into the response object but changes the header to contain Content-Disposition:"attachment;filename=file.ext”.
Any advice on the best way to solve this problem?
Content-Disposition:attachment is what you are looking for, yes. That is how you instruct browsers to download the file separately, and not try to display it.
You could use routing or rewriting to keep your file URLs, but have an ASHX handle the file so it can set that header. (don't use an ASPX; it's more than you need to just set some headers)
I think the work around that I was looking for was the fact that the 'Open files based on content, not file extension' option in IE8 was renamed, 'Enable MIME Sniffing' in IE9. But Andrew Barber's answer is the correct solution.

css file still not loading

I'm still having problems with loading the style sheet for these pages. Works fine in Safari but ff and IE, no joy:
http://www.mainstayprojects.com/teardrop.html andb
www.mainstayprojects.com
Although i am more clear as to what's causing this problem, thanks the the answers to my previous posting (stackoverflow.com/questions/3273655/css-file-not-loading), I am at a loss to how to fix the issue. I have re-saved many times with different doctypes and content type meta tag as well as saving the file as a charset=utf-8 file but have not been able make any headway!
Really need some help.
Your server is still claiming the HTML document is ISO-8859-1 (although the document itself looks like UTF-8).
Meanwhile the stylesheet appears to be UTF-8, the server fails to state what encoding it is, and the first line of the stylesheet claims that it is UTF-16.
Pick an encoding
Configure your editor to use it
Configure your server to specify it
If you put any information about the encoding at the document level — get it right!

How do tools like the web dev toolbar get the entire css file of a site?

The web dev toolbar for Firefox is quite an impressive tool.
What I am completely clueless about is how does this tool get the css stylesheet file of a site? This is hosted on a host which is secure etc. I am completely stumped.
I must be thinking about this in all the wrong way.
Thanks
The client (in this case Firefox) has to download the CSS file in order to render the page correctly. The plugin (in this case Firebug) simply requests the proper URL and the browser it gets it--most likely from the cache. There is no real mystery here.
In every HTML file, there's a link to the CSS stylesheet, or else the browser wouldn't know where to find it, thus losing the ability to render the page correctly.
It's in the form of <link rel="stylesheet" type="text/css" href="theme.css">,
I'd like to add that regardless of whether the host is 'secure' or not, it still is presenting the file to the client.
Unless, of course, you're looking at a XML file. Then you need to consult the XSL which'll tell you where the stylesheet is.

Resources