Why CSS does not work in ASP. NET

Source: Internet
Author: User
Copyright (c) 2007 Dorian Deng. Signature Sharing is not commercially available.
Reprinted please indicate the source: http://blog.csdn.net/doriandeng/archive/2007/09/16/1787279.aspx

 

In general, CSS does not work in ASP. NET. It only appears in IE 6 and earlier versions because the given CSS file contains inconsistent encoding characters.
Such as the following CSS files:

Body /**/ /*Normal style*/
{...} {
Color:# Ffffff;
}

It contains Chinese and English characters. By default, Asp. net sends a response in UTF-8 encoding. If the CSS file is saved as gb2312, IE6 will not be able to parse the Chinese characters in the file, and thus the style cannot be applied. This is because the CSS class does not work.
The solution is as follows:
1. Open the CSS file
2. Select [advanced save option] 1 in the [file] menu:

Figure 1

Select the UTF-8 encoding, [OK], and then save it.

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.