FAQPage-itemtype需要是根元素吗?

huangapple go评论69阅读模式
英文:

Does a FAQPage-itemtype need to be the root?

问题

我想开始向一些网站添加更多的结构化数据。问题是页面由多个部分组成。

Google的示例是:

<html itemscope itemtype="https://schema.org/FAQPage">

但是这个FAQPage类型需要放在html标签上吗?
如果我的页面包含在默认文本页面中的FAQ部分怎么办?
我能否将所有FAQ内容放在像这样的div中?

<div class="faq-container" itemscope itemtype="https://schema.org/FAQPage">
...
</div>

如果可以的话,我还能在我的<html>标签上使用Webpage类型吗?

英文:

I want to start adding more structured data to some sites. The problem is that pages are being composed of multiple pieces.

Google's example has:

&lt;html itemscope itemtype=&quot;https://schema.org/FAQPage&quot;&gt;

But does this FAQPage-type need to be on the html-tag?
What if my page contains a FAQ-section within a default textpage?
Can I just place all the FAQ content within a div like this?

&lt;div class=&quot;faq-container&quot; itemscope itemtype=&quot;https://schema.org/FAQPage&quot;&gt;
...
&lt;/div&gt;

And if so, can I still have a Webpage-type on my &lt;html&gt; tag?

答案1

得分: 1

我刚在“Rich Result Tester”中进行了测试,正如我所预期的那样,“FAQPage”不必在HTML元素上。

英文:

I just tested it in the Rich Result Tester, and as I expected, the FAQPage does not have to be on the HTML element.

答案2

得分: 1

通过在一个 html 元素上设置类型为 FAQPage,您告诉搜索引擎和浏览器整个 HTML 文档都是 FAQ,包括元数据内容。如果元数据具有适当的内容,这可能是有意义的。

结构化数据必须代表特定内容。您可以在打开 FAQ 内容容器的最近元素上设置类型为 FAQPage,这样可以最小化类型为 FAQPage 内部的额外源代码。

英文:

By setting the type FAQPage on an html element, you are telling search engines and browsers that this entire HTML document is FAQ, including the meta content. This may make sense if the metadata has the appropriate content.

Structured data must represent specific content. You can set the type FAQPage on the nearest element that opens the FAQ content container. This minimizes the extra source code inside the type FAQPage.

huangapple
  • 本文由 发表于 2023年5月26日 16:41:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76339106.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定