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!