我有一个常见问题解答页面,我想用更好的 html 架构来实现它。
<main role="main" itemscope itemtype="http://schema.org/WebPage">
<article itemprop="mainContentOfPage">
<header>
<h1>Frequently Asked Questions</h1>
</header>
<section itemscope itemtype="http://schema.org/Question">
<h2 itemprop="name">Some question #1</h2>
<p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
<span itemprop="text">This is an answer #1</span>
</p>
</section>
<section itemscope itemtype="http://schema.org/Question">
<h2 itemprop="name">Some question #2</h2>
<p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
<span itemprop="text">This is an answer #2</span>
</p>
</section>
<section itemscope itemtype="http://schema.org/Question">
<h2 itemprop="name">Some question #3</h2>
<p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
<span itemprop="text">This is an answer #3</span>
</p>
</section>
</article>
</main>
我认为更好的页面类型是FAQPage
代替WebPage
, but FAQPage
处于待处理状态,并且未在 Google 结构化数据测试工具中进行验证。
您对这个方案有何看法?这是对的吗?
FAQPage http://schema.org/FAQPage将是页面的最佳类型。如果您不想在发布之前使用它,WebPage
是最好的选择。您现在也可以考虑使用这两种类型,然后删除WebPage
立刻FAQPage
是核心词汇的一部分(或删除FAQPage
如果它去attic http://attic.schema.org/):
<main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">
我不会使用mainContentOfPage
财产。它期望一个WebPageElement
,这通常没有用。
就你而言,Question
项目未连接到WebPage
物品。为此,您可以使用hasPart财产 http://pending.schema.org/hasPart.
<main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">
<section>
<h2 itemprop="name">Frequently Asked Questions</h2>
<article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
<article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
<article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
</section>
</main>
(我切换了article
and section
元素,因为我认为从语义上讲,这样更有意义。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)