Facebook URL Linter错误地在微数据标记上抛出错误

时间:2011-11-07 19:16:19

标签: facebook html5 microdata

Facebook URL Linter现在在看到头部以外的标签时会抛出错误。问题是这些标签用于微数据标记。

所以在我的HTML中,在正文中,我会有相当于的标签:

<meta itemprop="ratingValue" content="5"/>

它必须位于<body>,因为它需要封装在我<DIV>中,我指定了必要的itemprop值。即:

<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
    ...
    <meta itemprop="ratingValue" content="5"/>
</div>

当我第一次实施微数据标记时,Facebook URL linter从未在此处引发错误,但是当我今天对其中一个页面进行检查时,显示的错误是:

Body Meta: You have <meta> tags ouside of your <head>. This is either because your <head> was malformed and they fell lower in the parse tree, or you accidentally put your Open Graph tags in the wrong place. Either way you need to fix it before the tags are usable.

我对Google's documentation on Microdata进行了一次双重检查,它有一个代码示例也有一个META标记必须在头部之外,因为它嵌套在<DIV>中:

<div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">
Rating: <span itemprop="value">8.5</span>
<meta itemprop="best" content="10" />
</div>

其他人也有这个问题吗?

0 个答案:

没有答案