使用 itemprop="articleBody"
在多个元素上。我这样问是因为我的页面是这样的。
<main class="post content">
<article itemscope itemType="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">My Blog Headline</h1>
<p><time class="dt-published" itemprop="datePublished" pubdate datetime="2015-01-24 19:08:00">Jan 24, 2015</time></p>
<p itemprop="author">Published by <a class="p-author h-card" itemprop="name" href="http://author.co.uk">Author Name</a></p>
</header>
<section itemprop="articleBody">
<p>Article body</p>
<p>Article body</p>
</section>
<section class="gallery">
...
</section>
<section itemprop="articleBody">
<p>Article body</p>
<p>Article body</p>
</section>
</article>
</main>
我有一个图库,位于我的文章主体之间,是否可以使用 itemprop="articleBody"
在多个 section
像上面一样?
P.S.是否也是不好的做法,使用 display: none
在我 itemprop="author"
? 我不想让它成为页面设计的一部分,有没有其他方法解决这个问题?
1) 至于你的主旨问题,我也是同样的情况,我找不到证据证明这是一种不好的做法。多个 articleBody
标记不被 谷歌结构化数据测试工具;这不是证明有效,而是线索。
2) 至于你的P.S. 问题,关于 隐姓埋名您可以将这一行替换为:
<p itemprop="author">Published by <a class="p-author h-card" itemprop="name" href="http://author.co.uk">Author Name</a></p>
换成这行
<div itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Author Name" />
</div>
顺便说一下,上面这几行还写着: author
是一个 Person
而非 Thing
.