blob: 3b9f63afea536c2fa2c6e6642b7d093f2fc4dc7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
---
title: itemref
slug: Web/HTML/Global_attributes/itemref
tags:
- Global attribute
- HTML
- HTML Microdata
- Reference
translation_of: Web/HTML/Global_attributes/itemref
---
<div>{{HTMLSidebar("Global_attributes")}}</div>
<p><strong><code>itemref</code></strong> <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>을 사용하면 {{htmlattrxref("itemscope")}} 특성을 가진 요소 바깥의 속성도 아이템과 연결할 수 있습니다.</p>
<p><code>itemref</code> 특성에는 문서 내 다른 요소의 {{htmlattrxref("id")}} 목록({{htmlattrxref("itemid")}} 아님)을 제공해야 합니다.</p>
<p><code>itemref</code> 특성은 <code>itemscope</code> 특성을 지정한 요소에만 추가할 수 있습니다.</p>
<p class="note"><strong>참고: </strong><code>itemref</code> 특성은 마이크로데이터 데이터 모델의 일부가 아니며, 트리 구조를 따르지 않는 데이터에 웹 작성자가 주석을 추가하는 것을 돕는 구문 구조에 불과합니다. 예를 들어, 표의 열이 별개의 아이템인데 데이터 속성은 열을 구성하는 칸에 포함하고 싶은 경우 사용할 수 있습니다.</p>
<h2 id="예제">예제</h2>
<h3 id="HTML">HTML</h3>
<pre class="brush: html"><div itemscope id="amanda" itemref="a b"></div>
<p id="a">Name: <span itemprop="name">Amanda</span> </p>
<div id="b" itemprop="band" itemscope itemref="c"></div>
<div id="c">
<p>Band: <span itemprop="name">Jazz Band</span> </p>
<p>Size: <span itemprop="size">12</span> players</p>
</div>
</pre>
<h3 id="구조화_데이터">구조화 데이터</h3>
<p><small>(<a href="https://json-ld.org/" rel="external">JSON-LD</a> 형식)</small></p>
<pre class="brush: json">{
"@id": "amanda",
"name": "Amanda",
"band": {
"@id": "b",
"name": "Jazz Band",
"size": 12
}
}
</pre>
<h3 id="결과">결과</h3>
<p>{{EmbedLiveSample('예제')}}</p>
<h2 id="명세">명세</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML Microdata', "#dfn-itemref", "itemref")}}</td>
<td>{{Spec2('HTML Microdata')}}</td>
<td></td>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', "microdata.html#attr-itemref", "itemref")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td></td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("html.global_attributes.itemref")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>다른 <a href="/ko/docs/Web/HTML/Global_attributes">전역 특성</a>.</li>
<li>마이크로데이터 관련 다른 전역 특성
<ul>
<li>{{htmlattrxref("itemid")}}</li>
<li>{{htmlattrxref("itemprop")}}</li>
<li>{{htmlattrxref("itemref")}}</li>
<li>{{htmlattrxref("itemtype")}}</li>
</ul>
</li>
</ul>
|