CSS encoding is inconsistent with page encoding, leading to ineffective style in IE6

Source: Internet
Author: User
Some time ago with the art to do a system when using Visual studio2005, the page is gb2312 code, while the art side of the CSS style is the UTF-8 code. As a result, many styles cannot be correctly displayed.
Today, I met the CSS style downloaded from the Internet, which cannot be correctly displayed on my UTF-8 page (Firefox can be correctly displayed, IE6 can't ). Later, the CSS styles referenced externally were put on the page using <style type = "text/CSS"> </style>, and both of them were correctly displayed. After elimination, we found that it was a coding problem. The CSS style downloaded from the Internet uses the gb2312 code.

Later, create a new UTF-8 CSS file in Dreamweaver, and then copy all the content in the CSS file in gb2312 format

The created CSS file is as follows:

After comparison, we can find that the UTF-8 code word body has the feeling of being squashed, I hope you can pay attention to this problem in the future.
Why does Firefox display normally? I guess Firefox by default is probably the cause of the UTF-8 code, specific unknown. Please correct your skills.
The same problem applies to JS files. If the JS file encoding is inconsistent with the page encoding, problems may also occur. Solution:
1. Create charset for JS: for example, <SCRIPT type = "text/JavaScript" src = "http://www.cnblogs.com/extJs-lib/scripts/ext/ext-lang-zh_CN.js" charset = "UTF-8">
2. At the beginning, I used the same encoding to write Js. Of course, many JS files downloaded from the Internet cannot be rewritten one by one. Here we recommend a converter.
/Files/showker/gb2utf8.rar
3. Open it in notepad and save it as "UTF-8" encoding. However, this method is not available and sometimes does not work.
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.