aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/html/element/menu/index.html
blob: c6034eb98eb16a95b7826bc8da21d0b6e142a51f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
title: <menu>
slug: Web/HTML/Element/menu
translation_of: Web/HTML/Element/menu
---
<div>{{HTMLRef}}{{SeeCompatTable}}</div>

<p><strong>HTML <code>&lt;menu&gt;</code> 요소</strong>는 사용자가 수행하거나 하는 명령 묶음을 말합니다. 이것은 스크린 위에 나오는 목록 메뉴와 눌려진 버튼 아래에 나오는 것과 같은 맥락 메뉴를 포함합니다.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories">Content categories</a></th>
   <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Flow content</a>. Additionally, if in the <em>list menu</em> state, palpable content. (<em>list menu</em> is the default state, unless the parent element is a {{HTMLElement("menu")}} in the <em>context menu</em> state.)</td>
  </tr>
  <tr>
   <th scope="row">Permitted content</th>
   <td>If the element is in the <em>list menu</em> state: <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">flow content</a>, or alternatively, zero or more occurrences of {{HTMLElement("li")}}, {{HTMLElement("script")}}, and {{HTMLElement("template")}}.<br>
    If the element is in the <em>context menu</em> state: zero or more occurrences, in any order, of {{HTMLElement("menu")}} (<em>context menu</em> state only), {{HTMLElement("menuitem")}}, {{HTMLElement("hr")}}, {{HTMLElement("script")}}, and {{HTMLElement("template")}}.</td>
  </tr>
  <tr>
   <th scope="row">Tag omission</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">Permitted parent elements</th>
   <td>Any element that accepts <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">flow content</a>.</td>
  </tr>
  <tr>
   <th scope="row">DOM interface</th>
   <td>{{domxref("HTMLMenuElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="속성">속성</h2>

<p>이 요소는 <a href="/en-US/docs/Web/HTML/Global_attributes">전역 속성</a>을 포함합니다.</p>

<dl>
 <dt>{{htmlattrdef("label")}}</dt>
 <dd>사용자에게 보여지는 메뉴의 이름입니다. Used within nested menus, to provide a label through which the submenu can be accessed. Must only be specified when the parent element is a {{HTMLElement("menu")}} in the <em>context menu</em> state.</dd>
 <dt>{{htmlattrdef("type")}}</dt>
 <dd>This attribute indicates the kind of menu being declared, and can be one of two values.
 <ul>
  <li><code>context</code>: The <em>context menu</em> state, which represents a group of commands activated through another element. This might be through the {{htmlattrxref("menu", "button")}} attribute of a {{HTMLElement("button")}}, or an element with a <a href="/en-US/docs/HTML/Global_attributes#attr-contextmenu"><code>contextmenu</code></a> attribute. When nesting {{HTMLElement("menu")}} elements directly within one another, this is the missing value default if the parent is already in this state.</li>
  <li><code>list</code>: The <em>list menu</em> state, which represents a series of commands for user interaction. This is the missing value default, except where the parent element is a {{HTMLElement("menu")}} in the <em>context menu</em> state.</li>
 </ul>
 </dd>
</dl>

<h2 id="Examples">Examples</h2>

<h3 id="Example_1">Example 1</h3>

<pre class="brush: html">&lt;!-- A button, which displays a menu when clicked. --&gt;
&lt;button type="menu" menu="dropdown-menu"&gt;
  Dropdown
&lt;/button&gt;

&lt;menu type="context" id="dropdown-menu"&gt;
  &lt;menuitem label="Action"&gt;
  &lt;menuitem label="Another action"&gt;
  &lt;hr&gt;
  &lt;menuitem label="Separated action"&gt;
&lt;/menu&gt;
</pre>

<h3 id="Result">Result</h3>

<p>{{EmbedLiveSample('Example_1')}}</p>

<h3 id="Example_2">Example 2</h3>

<pre class="brush: html">&lt;!-- A context menu for a simple editor, containing two menu buttons. --&gt;
&lt;menu&gt;
  &lt;li&gt;
    &lt;button type="menu" value="File" menu="file-menu"&gt;
    &lt;menu type="context" id="file-menu"&gt;
      &lt;menuitem label="New..." onclick="newFile()"&gt;
      &lt;menuitem label="Save..." onclick="saveFile()"&gt;
    &lt;/menu&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;button type="menu" value="Edit" menu="edit-menu"&gt;
    &lt;menu type="context" id="edit-menu"&gt;
      &lt;menuitem label="Cut..." onclick="cutEdit()"&gt;
      &lt;menuitem label="Copy..." onclick="copyEdit()"&gt;
      &lt;menuitem label="Paste..." onclick="pasteEdit()"&gt;
    &lt;/menu&gt;
  &lt;/li&gt;
&lt;/menu&gt;
</pre>

<h3 id="Result_2">Result</h3>

<p>{{EmbedLiveSample('Example_2')}}</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 WHATWG', 'interactive-elements.html#the-menu-element', '&lt;menu&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5.1', 'interactive-elements.html#the-menu-element', '&lt;menu&gt;')}}</td>
   <td>{{Spec2('HTML5.1')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<p>{{Compat("html.elements.menu")}}</p>

<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li>Other list-related HTML Elements: {{HTMLElement("ol")}}, {{HTMLElement("ul")}}, {{HTMLElement("li")}} and the obsolete {{HTMLElement("dir")}}.</li>
 <li>The <a href="/en-US/docs/HTML/Global_attributes#attr-contextmenu"><code>contextmenu</code></a> <a href="/en-US/docs/HTML/Global_attributes">global attribute</a> can be used on an element to refer to the <code>id</code> of a <code>menu</code> with the <code>context</code> {{htmlattrxref("type","menu")}}.</li>
</ul>