


美國NASDAQ上市公司
外商IT教育培訓企業
目錄 1. Schema 語意標記小百科 2. Microdata(微數據)的格式 2-1. 什麼是微數據? 2-2. 微數據的例子 2-3. 微數據的語法 3. JSON-LD 的格式 2-1. 什麼是 JSON-LD? 2-2. JSON-LD 的例子與語法 4. RDFa 的格式 4-1. 什麼是 RDFa? 4-2. RDFa 的例子與語法 |
<div><h1>艾莉塔:戰鬥天使</h1> <span>導演:詹姆士·卡麥隆 (生於1954年8月16日)</span>
<span>類型:賽博叛客動作片</span>
<a href="..//movies/Alita-Battle-Angel-trailer.html">電影預告片</a>
</div>
這個 HTML 代碼若加了Microdata 微數據來宣告其資料類型,就可以讓搜尋引擎更容易辨識其類型。
<div itemscope itemtype="https://schema.org/Movie"> <!--宣告要使用 schema.org 的 movie(電影)類來呈現資料-->
<h1 itemprop="name">艾莉塔:戰鬥天使</h1> <!--宣告在movie(上一行指定)的類型下,該類型的項目"name"(片名)是什麼-->
<div itemprop="director" itemscope itemtype="http://schema.org/Person"> <!--宣告要使用 schema.org 的 person(人物)類來呈現資料,並選擇 director 項目-->
導演:<span itemprop="name">詹姆士·卡麥隆</span> (生於<span itemprop="birthDate">1954年8月16日)</span></div>
類型:<span itemprop="genre">賽博叛客動作片</span>
<a href="../movies/Alita-Battle-Angel-trailer.html" itemprop="trailer">電影預告片 </a>
</div>
<div itemscope itemtype="http://schema.org/Movie"></div>
<span itemprop="name">艾莉塔:戰鬥天使</span>
<time itemprop="startDate" datetime="2019-03-02T19:00-08:00" > 2019年03月02日晚上7點 </time>
<div itemscope itemtype="https://schema.org/Movie" >
<h1 itemprop="name" >艾莉塔:戰鬥天使</h1>
<div itemprop="director" itemscope itemtype="http://schema.org/Person">
導演:<span itemprop="name">詹姆士·卡麥隆</span> (生於<span itemprop="birthDate">1954年8月16日)</span> </div>
類型:<span itemprop="genre">賽博叛客動作片</span>
<a href = "../movies/avatar-theatrical-trailer.html" itemprop = "trailer" >電影預告片 </a>
</div>
<a href="" >
<area href="" >
<audio src="" >
<embed src="" >
<iframe src="" >
<img src="" >
<link href="" >
<object data="" >
<source src="" >
<video src="" >
<base href="" >
<script src="" >
<input src="" >
完整的微數據類型請參考:http://schema.org/docs/full.html
{上例用來表示:名字為「John」、姓氏為 「Smith」、性別為 「男」
"firstName": "John",
"lastName": "Smith",
"sex": "male",
}
<script type="application/ld+json"> {
"@context": "http://schema.org",
"@type": "Person",
"givenName": "John",
"familyName": "Smith",
"gender": "male",
}</script>
<div itemscope itemtype="https://schema.org/Person">
<h1 itemprop="givenName">John<h1> <h1 itemprop="familyName">Smith<h1>
<span itemprop="gender">male<h1>
</div>
<div vocab="http://schema.org" typeof="Person">上例用來表示:名字為「John」、姓氏為 「Smith」、性別為 「男」
<span property="givenName">John<span> <span property="familyName">Smith<span>
<span property="gender">male<span>
<div itemscope itemtype="https://schema.org/Person">
<h1 itemprop="givenName">John<h1> <h1 itemprop="familyName">Smith<h1>
<span itemprop="gender">male<h1>
</div>