【发布时间】:2015-05-21 07:39:37
【问题描述】:
为了更好的 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">
我该如何解决这个问题?
【问题讨论】:
-
请注意您must use the
linkelement (instead ofmeta) if the value is a URL。所以你的第三个meta元素应该是这样的:<link itemprop="image" href="http://www.example.com/image.jpg">
标签: seo meta-tags w3c-validation schema.org microdata