我应该以 utf-8 格式编写元标记吗?
例如,可以在元关键字中使用双引号,如下所示:
19" wheels
或特殊字符,如 & 符号...?
谢谢
注意:我在所有页面上都使用 utf-8 编码!
我应该以 utf-8 格式编写元标记吗?
您应该始终使用一致的编码。
例如,可以在元关键字中使用双引号吗
与所有属性值一样,您不能在值中使用分隔属性值的字符而不用实体表示它。
<meta name="length" content="19""> <!-- This is an error -->
<meta name="length" content='19"'> <!-- This is fine -->
<meta name="length" content='19"'> <!-- This is fine -->
<meta name="length" content="19""> <!-- This is fine -->
<meta name="length" content="19″"> <!-- Using the double prime character is also fine.
It is distinct from the double quotes used to
delimit the attribute value.
Technically, it is the best option as it is the
correct character to represent an inch.
-->
或特殊字符,如 & 符号...?
有时您可以在 HTML 数据中使用原始 & 符号,但它们并不常见,而且总是更容易使用,&
然后尝试记住异常。