对于以下行,我遇到了HTML验证错误,如果我不在meta标签中指定字符集,我不知道应该在哪里指定它。
Line 5, Column 70: Attribute charset not allowed on element meta at this point.
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
对于以下行,我遇到了HTML验证错误,如果我不在meta标签中指定字符集,我不知道应该在哪里指定它。
Line 5, Column 70: Attribute charset not allowed on element meta at this point.
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
Content-type
元标签中,这是不被允许的。只需要创建一个单独的元标签,例如:<meta charset="utf-8" />
是的。你应该使用这种方式,因为它在html5中被推荐,并且它是一项新的建议。
下面是一个简单的html5布局:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>
charset
在content
属性中像这样<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
,那么您拥有的元标记就可以了。 - Olly Hodgson