为了更好的SEO,我需要在我的页面上添加一些像这样的元标记:
<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg">
然后我在Markup Validation Service上检查了这段代码:
<!DOCTYPE html>
<html>
<head lang="en">
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg">
<meta charset="UTF-8">
<title>My title</title>
</head>
<body>
My body.
</body>
</html>
抛出此错误:
第4行,第57列:指定了
itemprop
属性,但元素不是任何项目的属性。
<meta itemprop="name" content="The Name or Title Here">
第5行,第70列:已指定
itemprop
属性,但该元素不是任何项的属性。
<meta itemprop="description" content="This is the page description">
第6行,第68列:已指定
itemprop
属性,但该元素不是任何项的属性。我该如何修复这个问题?
<meta itemprop="image" content="http://www.example.com/image.jpg">
link
元素(而不是meta
)。因此,您的第三个meta
元素应该是这样的:<link itemprop="image" href="http://www.example.com/image.jpg">
。 - unor