網路城邦
上一篇 回創作列表 下一篇   字體:
Microdata是幫助搜索引擎瞭解網頁的重要標籤
2017/01/28 15:42:48瀏覽14372|回應0|推薦0
Microdata提供機器化的程式更容易讀取網頁中要表達的內容。除了各大搜索引擎認可外,並且相容RDF與JSON數據格式。

Microdata是幫助搜索引擎瞭解網頁的重要標籤

W3C中特別提到

This specification defines the HTML microdata mechanism. This mechanism allows machine-readable data to be embedded in HTML documents in an easy-to-write manner, with an unambiguous parsing model. It is compatible with numerous other data formats including RDF and JSON.

要使用Microdata增加網頁的可讀性,需要有基本HTML概念,如果只會使用Dreamweaver視覺化方式設計網頁,而不會使用文字模式編寫網頁就不適合。

基礎網頁語法

首先需要使用itemscope標籤包裹itemprop屬性。

<div itemscope>
 <p>我的名字叫<span itemprop="name">王大明</span>。</p>
</div>

<div itemscope>
 <p>作者的名字是<span itemprop="name">張銘倫</span>。</p>
</div>

在itemprop屬性中如果包含其他html語法不會影響Microdata讀取結果,Microdata只會讀取文字敘述,並不會將文字敘述中包含的網頁語法列入考量,所以有些人想要透過加入<strong>或是<b>之類的標籤強化特定文字,對於Microdata來說是多餘的。

( 知識學習科學百科 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇