Vi dữ liệu
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Vi dữ liệu là một quy cách để nhúng dữ liệu mà máy có thể đọc vào tài liệu HTML. Dữ liệu vi mô bao gồm các cặp tên-giá trị (còn gọi là items
) được xác định theo một từ vựng. schema.org cung cấp một bộ sưu tập các từ vựng đánh dấu thường dùng.
Cú pháp cơ bản bao gồm thuộc tính itemscope
để xác định một mục và thuộc tính itemprop
để mô tả một trong các thuộc tính của mục đó. Các loại được chỉ định bằng thuộc tính itemtype
và có thể giả định các giá trị được xác định trong từ vựng mà bạn chọn. Ví dụ: schema.org
xác định các loại như http://schema.org/Person
hoặc http://schema.org/PostalAddress
.
Ví dụ sau đây (trên Wikipedia) cho thấy cách sử dụng vi dữ liệu để mô tả một người:
<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>
Hãy kiểm tra công cụ Trình xác thực schema để gỡ lỗi mã đánh dấu và xác thực mã đó dựa trên schema được hỗ trợ.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-29 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[],[],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."]]