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

后端 未结 4 1406
执念已碎
执念已碎 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:13

    One reason to always include a character set specification on every page containing text is to avoid cross site scripting vulnerabilities. In most cases the UTF-8 character set is the best choice for text, including HTML pages.

提交回复
热议问题