CSS and webpage encoding are inconsistent, leading to incorrect style in IE6

Source: Internet
Author: User

The Helper House (www.bkjia.com) Tutorial used Visual Studio2005 to build a system with the artist some time ago, and the page uses the GB2312 code, while the art CSS style over there is the use of 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 style referenced by the entire external is put into the page, and both of them can be 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 a charset for js:

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 with the same encoding to write js. Of course, a lot of js downloaded from the internet can not be repeated one by one, the recommended Conversion Tool: http://tool.bkjia.com/

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.