Problem description:
I recently wrote a website that adopts the DIV + CSS layout. In the debugging process, we found that IE7 and FF are both compatible. However, when IE6 is not compatible, the style of some layers does not work and is not executed at all, just like losing control. The layout was rewritten twice. Is it true that IE6 has such a difficult compatibility.
Solution:
Step 1: Find a machine in the IE environment, install DW for layout, and find that the CSS is not compatible with IE6, and there are some minor changes.
Step 2: Apply the CSS to the project. IE7 and FF are normal, but the IE6 problem still exists. Just try uploading the HTML static pages tested in the DW environment to the server. The resolution result is the same as that of a single server.
Step 4: the cause of the analysis is that the parsing result of Asp.net is different from that of HTML. Try to paste the content of the static page to the aspx file for testing. The results are still out of order.
Step 5: Compare the execution result of the aspx file with that of the HTML file. Is it Asp.net internal parsing execution ??
Step 6: Check the information online. Comments will affect the style execution. Therefore, the style comments written in the CSS file are removed, and the style comments on the page are removed and executed. The test results are displayed in a general layout, but the local style is still not applied.
Step 7: Considering the file encoding problem, isn't the CSS style file not recognized?
View the attributes of the CSS file. The original encoding is ANSI, while Asp.net supports UTF-8. Open the CSS file in notepad and save it as a Utf-8 encoding file. The test result is HTML file execution.
Step 8: use it! Important partially corrected the IE6 execution style, and the page execution results achieved the expected results.
Summary:
In the DW environment, CSS files are encoded in ANSI. Apply it to the ASP. net2.0 project and modify its encoding method.
CSS style files are recommended not to be annotated. Annotations May cause parsing errors and style exceptions in some cases.