Why specify @charset “UTF-8”; in your CSS file?

后端 未结 4 1401
执念已碎
执念已碎 2020-11-28 18:59

I\'ve been seeing this instruction as the very first line of numerous CSS files that have been turned over to me:

@charset \"UTF-8\";

What

4条回答
  •  醉梦人生
    2020-11-28 19:04

    If you're putting a tag in your css files, you're doing something wrong. The tag belongs in your html files, and tells the browser how the html is encoded, it doesn't say anything about the css, which is a separate file. You could conceivably have completely different encodings for your html and css, although I can't imagine this would be a good idea.

提交回复
热议问题