IE6 cannot parse CSS files correctly due to encoding issues

Source: Internet
Author: User

This article is a reprinted article. It is a problem encountered by a netizen in his actual work. I have reposted this article at the School of building a website in the fire. You may have some experience when encountering such problems.

IE6 and encoding are all these problems. Today, when I made a webpage, I found that browsers earlier than IE6 cannot correctly display CSS. CSS does not seem to have any effect! IE7, Opera9, and Firefox2 have no problems. After a long period of analysis and research, I found the cause of the problem:

The web page uses the UTF-8 encoding format, which is no problem, the problem is that the external CSS file defaults to ANSI encoding and is not saved as the UTF-8 format. You may find that this is not a problem in general. However, when a CSS file contains Chinese comments, it may be unsatisfactory! I guess that browsers earlier than IE6 cannot correctly parse the CSS file because of the encoding problem, so CSS does not work in IE6. It seems that Microsoft has noticed this problem and fixed it in IE7.

However, there are still many Internet Explorer 6 users. Therefore, this problem must be solved:
Method 1: the CSS, JS and web files are stored in a unified UTF-8 format.
Method 2: Remove Chinese comments in CSS and JS, or change them to English.

Of course, the best wish is that everyone is using the latest version of the browser, secure and keep pace with the times!

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.