IE6 the solution and reason analysis of the problem of parsing CSS files _ experience Exchange

Source: Internet
Author: User
The Web page uses the UTF-8 encoding format, which originally has no problem, the problem is that the external CSS file is ANSI-encoded by default and is not saved in the UTF-8 format. You may find that in general this is not a problem, however, when the CSS file contains Chinese comments, it may not be satisfactory! It is estimated that the IE6 version of the browser in the parsing of this CSS file because of coding problems and can not parse correctly, so the CSS will not work under IE6. It seems that Microsoft has noticed this problem and fixed it in IE7. But there are still a lot of people with IE6. So the problem needs to be addressed:
  
Method One: The CSS, JS and Web files are saved uniformly into the UTF-8 format.
Method Two: Remove the CSS, JS in the Chinese comments, or change to English.
  
The above is IE6 because the encoding problem cannot parse the CSS file correctly
Sometimes we find that we write HTML page referencing external CSS files in IE7 and FF can be very well parsed, that can be displayed normally, but in the IE6 is completely unresolved, that is, the CSS file style is not applied to our HTML page, what is the matter? At first I copied all the styles in the CSS file into the HTML page , so after that, IE6, IE7, FF can be displayed normally, this also shows that the external CSS file should be what the problem, why in the IE6 this problem, But not in IE7 and FF? Google on the Internet, the discovery is IE6 in the page encoding has strict requirements, I looked at the next, a friend sent over the CSS file with the code is GB2312, and the HTML file is Utf-8, the original problem is here, I put the CSS file content encoding with Ed to Utf-8, again test, everything back to normal, there is I found a friend's CSS file in Chinese comments, seriously suggest friends do not in the CSS file in Chinese to comment, this will also cause coding problems.
  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.