How to successfully use Chinese comments in CSS

From: http://blog.sina.com.cn/s/blog_4d96ee050100tvqj.html


When I was debugging a CSS menu just now, I found that Chinese was added to the CSS comment, and it was invalid. If it is changed to English, it is normal again. I heard from a friend that under IE6, Css does not support Chinese comments . Either write in English, or don't write at all. It's really depressing, because I also have Chinese in another css style file, and the work is normal. Checked the css file encoding, it is GB2312, and the web page encoding UFF-8 does not match, then changed to UTF-8 encoding test, solved.

 

To summarize the solution:

 

Method 1:
First check whether your page file document encoding and CSS document encoding are consistent. If they are inconsistent, manually modify them to make them consistent.
Example:
The encoding used by your page file is "Simplified Chinese (GB2312)" and the encoding used by your CSS file is "UTF-8". In this case, just manually modify the document encoding of your CSS file (because we do Websites generally use GB2312 , and the page file can also be modified).
In Dreamweaver8 → Modify → Page Properties → Document Encoding → Simplified Chinese ( GB2312 )

 

Method 2: Generally, the
CSS comments we insert in Dreamweaver8 are like this by default: / * comment content * / , and just change this to / * * comment content * * / or / * - comment content - * / .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325817198&siteId=291194637