英文:
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:
<html itemscope itemtype="https://schema.org/FAQPage">
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?
<div class="faq-container" itemscope itemtype="https://schema.org/FAQPage">
...
</div>
And if so, can I still have a Webpage-type on my <html>
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论