5

我收到以下行的 HTML 验证错误,如果我不在元标记内执行此操作,我不确定应该在哪里指定我的字符集。

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"/>
4

2 回答 2

9

这是因为您将其放在Content-type元标记中,这是不允许的。

只需制作一个单独的元标记,例如

<meta charset="utf-8" />

这应该为您验证。

于 2013-10-25T15:18:59.100 回答
6

是的。您应该使用它,因为这是 html5 中推荐的,它是一个新的推荐。

下面是一个简单的 html5 布局:

<!DOCTYPE html>
<html> 
<head> 
<meta charset="UTF-8"> 
<title>Title of the document</title> 
</head>

<body> 
Content of the document...... 
</body>

</html>
于 2013-10-25T15:31:39.110 回答