了解 Stack Overflow 中的 Schema.org

Understanding Schema.org in Stack Overflow

如果你在这个 post 的底部检查我的名字,你会看到:

<div class="user-details" itemprop="author" itemscope="" itemtype="http://schema.org/Person">

添加这些属性 (itemtype/itemprop) 可能带来哪些好处?

它用于 SEO。

Most webmasters are familiar with HTML tags on their pages. Usually, HTML tags tell the browser how to display the information included in the tag. For example,

Avatar

tells the browser to display the text string "Avatar" in a heading 1 format. However, the HTML tag doesn't give any information about what that text string means—"Avatar" could refer to the hugely successful 3D movie, or it could refer to a type of profile picture—and this can make it more difficult for search engines to intelligently display relevant content to a user.

> Schema.org provides a collection of shared vocabularies webmasters can use to mark up their pages in ways that can be understood by the major search engines: Google, Microsoft, Yandex and Yahoo!

You use the schema.org vocabulary along with the Microdata, RDFa, or JSON-LD formats to add information to your Web content. This guide will help get you up to speed with Microdata and schema.org so that you can start adding markup to your web pages.

来源:https://schema.org/docs/gs.html

此外,itemprop 属性是全局属性,用于向项目添加属性。 参见:https://developer.mozilla.org/de/docs/Web/HTML/Global_attributes/itemprop