Export (0) Print
Expand All

MIME types and stylesheets

Web servers send a HTTP response header named "Content-Type" that specifies the MIME-type of the file that is being sent. For security and standards-compliance reasons, style sheets should be delivered with the "text/css" MIME type.

  • Starting with IE9 Standards mode, style sheets will be ignored (not applied) unless they are delivered with a "text/css" MIME type.
  • In all document modes, style sheets will be ignored if the style sheet is delivered with the "X-Content-Type-Options: nosniff" header and the style sheet is not delivered with the "text/css" MIME type.
  • In all document modes (and in legacy browser versions) style sheets delivered from a cross-origin context (for example, example.com uses a style sheet from microsoft.com) will be ignored unless the style sheet is delivered with the "text/css" MIME type.

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 Windows Internet Explorer 9 F12 Developer Tools console.

Ensure that all style sheets are delivered with the proper HTTP response header: "Content-Type: text/css".

If you find any sites that are sending improper MIME types and behave incorrectly in Windows Internet Explorer, please file a bug on Connect.

A concise test case displays red text if a browser applies styles from a style sheet with an incorrect MIME type; it renders the text in green if the invalid style sheet is correctly ignored.

Related Topics



© 2014 Microsoft