When you write the page in Chrome,fireforks and other pages on the display of normal, but replaced by IE9 after completely no style. IE is a wonderful freak. Its error message is ' CSS is ignored because of Mime type mismatch ', which means that all of the. css files are all out of effect. Went to the internet to look up some information, there are many answers related to this question.
The first thing to understand is what the mine type is. MIME type is the type of file that sets a specified extension to open with an application, and when the file is accessed, the browser automatically opens with the specified application, specifying some client-defined file names and how some media files are opened. The main related is the Web.xml file. Web.xml is a very important configuration file in a network program. When a Web project is started, the Web container reads its configuration file web.xml, reading <listener> and <context-param> these two nodes.
In the new security mechanism of IE9, it is required that the HTTP header information returned by the Web server content-type must specify the mime-type of the CSS file as ' text/css ', otherwise IE9 will not treat it as a CSS file. If you want IE9 to display CSS file-defined styles correctly, you need to modify the corresponding MIME type in the HTTP header header information for the CSS file returned to the client by the server side.
How to modify the returned CSS MIME information:
There are different ways to fix the return MIME information of a CSS file, one is to modify the server configuration or server program, and to export the correct mine header information for the CSS file. This to the IIS settings to operate, for their own server is feasible, but for the use of virtual host of the webmaster is not and easy to do, here is not to elaborate.
Another alternative approach is to require the server to output the correct CSS mine information by configuring the Web.xml file.
Add content to Web.xml:
Copy Code code as follows:
<mime-mapping>
<extension>css</extension>
<mime-type>text/css</mime-type>
</mime-mapping>