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";
Related
I am in the process of integrating Netlify CMS to a Gatsby site. Right now, while editing or creating content, a preview of the content appears to the right of the screen in plain text. Is it possible to use the same styles for both the main page and the preview page so that they both look same?
I assume since the preview page gets rendered using the page template and the page template comes with its own styles, there would be no need for an extra stylesheet.
I've tried linking the stylesheets using CMS.registerPreviewStyle("link/to/my/css/file"); but nothing changes.
The developer console returns the error
Refused to apply style from 'https://my-site-name.com/admin/cms.css'
because its MIME type ('text/html')" is not a supported stylesheet
MIME type, and strict MIME checking is enabled."
However when I try to load the style sheet directly, I get a 404 error showing that it does not exist.
What you are doing is correct, just make sure that the path is right. For example, make sure that your CSS files are nested in the static folder.
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.
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.
I have different sites being served up, essentially running off the same code. One page renders correctly, while the other appears to have no CSS available.
When I bring up the IE9 developer console for the broken page, I see:
SEC7113: CSS was ignored due to mime type mismatch
So that explains why the pages render improperly, but the question is, why am I seeing that error on one page, but not the other?
Using fiddler, the same CSS is served to both sites, and both sites have a the metatag:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
I know IE9 is still in beta, but I am trying to figure out why this is a problem with my site.
This doesn't look like an IE emulation thing - it sounds like the CONTENT-TYPE in the response isn't "text/css". It looks like IE9 enforces that files that are expected to contain CSS are actually marked as such.
Just out of interest, are the CSS pages processed in any way? i.e. are they rendered by an ASPX page to allow you to inject CSS? If that's the case then you may want to make sure your page declaration at the top includes the ContentType declaration, e.g.:
<%# Page Language="C#" ContentType="text/css" %>
It turns out, IE9 will ignore the missing content-types for all sites that in your "trusted-zone."
Sites outside of the trusted zone will not render the css if there is a missing content-type header.
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.