应该HTML元字符集是小写还是大写? [英] Should HTML meta charset be lowercase or uppercase?
问题描述
通常情况下, UTF
应该是大写,因为它是一个缩写。
然而,HTML中的属性通常是小写的。
所以,它应该是:< meta charset =UTF-8 />
或< meta charset =utf-8/>
?
我知道两者都有效。 >
谢谢。
charset的值不区分大小写。
从w3.org
对IANA [Character Sets]注册管理机构的名称或别名字段标记为首选MIME名称的任何字符集名称不敏感匹配;或者,如果没有任何Alias字段被标记,则不区分大小写匹配注册表中的Name字段。
链接到完整文档: http://www.w3.org/TR/html-标记/ meta.charset.html
Normally UTF
should be uppercased as it's an abbreviation.
However, attributes in HTML are normally lowercased.
So, should it be: <meta charset="UTF-8"/>
or <meta charset="utf-8"/>
?
I know both work.
Thank you.
The value for charset is case-insensitive.
From w3.org
A case-insensitive match for any character set name for which the IANA [Character Sets] registry has a Name or Alias field labeled as "preferred MIME name"; or, if none of the Alias fields are so labeled, a case-insensitive match for a Name field in the registry.
Link to full document: http://www.w3.org/TR/html-markup/meta.charset.html
这篇关于应该HTML元字符集是小写还是大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!