微数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
微数据是一种用于在 HTML 文档中嵌入机器可读数据的规范。微数据由根据词汇表定义的名称-值对(称为items
)组成。schema.org 提供了一系列常用的标记词汇。
基本语法包括用于定义商品的 itemscope
属性和用于描述商品属性的 itemprop
属性。类型使用 itemtype
属性指定,并且可以采用所选词汇表中定义的值。例如,schema.org
定义了 http://schema.org/Person
或 http://schema.org/PostalAddress
等类型。
以下示例(来自 Wikipedia)展示了如何使用微数据来描述一个人:
<section itemscope itemtype="http://schema.org/Person">
Hello, my name is
<span itemprop="name">John Doe</span>,
I am a
<span itemprop="jobTitle">Graduate research assistant</span>
at the
<span itemprop="affiliation">University of Dreams</span>
My friends call me
<span itemprop="additionalName">Johnny</span>
You can visit my homepage at
<a href="http://www.example.com.com" itemprop="url">www.example.com</a>
<section itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
I live at
<span itemprop="streetAddress">1234 Peach Drive</span>
<span itemprop="addressLocality">Warner Robins</span>
<span itemprop="addressRegion">Georgia</span>.
</section>
</section>
使用架构验证器工具调试您的标记,并根据支持的架构对其进行验证。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Microdata\n\n[Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)\nis a specification to embed machine-readable data in HTML documents. Microdata consists of name-value pairs (known as `items`) defined according to a vocabulary. A collection of commonly used markup vocabularies are provided by [schema.org](https://schema.org/).\n\nThe basic syntax includes the `itemscope` attribute to define an item and the `itemprop` attribute to describe one of the item's properties. Types are specified using the `itemtype` attribute and can assume values defined in the vocabulary of choice. For instance, `schema.org` defines types such as `http://schema.org/Person` or `http://schema.org/PostalAddress`.\n\nThe following example (from [Wikipedia](http://en.wikipedia.org/wiki/Microdata_(HTML)#Example)) shows how to use microdata to describe a person: \n\n \u003csection itemscope itemtype=\"http://schema.org/Person\"\u003e\n Hello, my name is\n \u003cspan itemprop=\"name\"\u003eJohn Doe\u003c/span\u003e,\n I am a\n \u003cspan itemprop=\"jobTitle\"\u003eGraduate research assistant\u003c/span\u003e\n at the\n \u003cspan itemprop=\"affiliation\"\u003eUniversity of Dreams\u003c/span\u003e\n My friends call me\n \u003cspan itemprop=\"additionalName\"\u003eJohnny\u003c/span\u003e\n You can visit my homepage at\n \u003ca href=\"http://www.example.com.com\" itemprop=\"url\"\u003ewww.example.com\u003c/a\u003e\n \u003csection itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\"\u003e\n I live at\n \u003cspan itemprop=\"streetAddress\"\u003e1234 Peach Drive\u003c/span\u003e\n \u003cspan itemprop=\"addressLocality\"\u003eWarner Robins\u003c/span\u003e\n \u003cspan itemprop=\"addressRegion\"\u003eGeorgia\u003c/span\u003e.\n \u003c/section\u003e\n \u003c/section\u003e\n\nCheck the [Schema Validator](/workspace/gmail/markup/testing-your-schema#schema_validator) tool to debug your markup and validate it against the supported schema."]]