IE6 the solution to the problem of CSS file parsing and the reason analysis _ Experience Exchange
Source: Internet
Author: User
The Web page uses the UTF-8 encoding format, which is no problem, the problem is that the external CSS file is ANSI encoded by default and is not saved as a UTF-8 format. You may find that in general this is no problem, however, when the CSS file contains a Chinese annotation may not be satisfactory! It is estimated that the IE6 version of the browser is parsing the CSS file because the encoding problem can not be resolved correctly, so the CSS will not work under the IE6. It appears that Microsoft has noticed the problem and repaired it in the IE7. But there are still a lot of people with IE6. So this problem needs to be addressed:
Method One: The CSS, JS and Web page files are uniformly saved as UTF-8 format.
Method Two: Remove the CSS, JS in the Chinese annotation, or change to English.
IE6 because the encoding problem does not parse the CSS file correctly
Sometimes we find that HTML pages we write can be well parsed in IE7 and FF when referencing external CSS files. That can be normal display, but in the IE6 is completely not resolved, that is, the CSS file style has not been applied to our HTML page, this is how it? At first, I copied all the styles in the CSS file to the <style></style> in the HTML page, so after that, IE6, IE7, FF will be able to display the normal, this also explains the external CSS file should be what the problem, Why does this problem occur in IE6, but not in IE7 and FF? Google on the internet, found that the IE6 of the page in the code has strict requirements, I looked at, friends sent over the CSS file with the code is GB2312, and HTML file is Utf-8, the original problem is here, I have CSS file content coding with Ed to Utf-8, Test again, everything back to normal, there is my friend's CSS file in Chinese comments, seriously advised friends do not in the CSS file in Chinese to annotate, this will also cause coding problems.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.