aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/html/element/menu/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ca/web/html/element/menu/index.html')
-rw-r--r--files/ca/web/html/element/menu/index.html184
1 files changed, 184 insertions, 0 deletions
diff --git a/files/ca/web/html/element/menu/index.html b/files/ca/web/html/element/menu/index.html
new file mode 100644
index 0000000000..e8f358df1f
--- /dev/null
+++ b/files/ca/web/html/element/menu/index.html
@@ -0,0 +1,184 @@
+---
+title: <menu>
+slug: Web/HTML/Element/menu
+translation_of: Web/HTML/Element/menu
+---
+<div>{{HTMLRef}}{{SeeCompatTable}}</div>
+
+<p>L'<strong>element</strong> <strong>HTML <code>&lt;menu&gt;</code></strong> representa un grup d'ordres que l'usuari pot realitzar o activar. Això inclou tant llistes com menús, que poden aparèixer a la part de dalt de la pantalla, com també menús de context, com les que poden aparèixer sota d'un botó després d'haver fet click.</p>
+
+<div class="note"><strong>Nota d'ús: </strong>Els elements {{HTMLElement("menu")}} i {{HTMLElement("ul")}} representen una llista no ordenada d'ítems. La diferència clau es que {{HTMLElement("ul")}} conté principalment ítems per mostrar, mentre que {{HTMLElement("menu")}} està destinat a elements interactius</div>
+
+<p class="note"><strong>Notes: </strong>This element was deprecated in HTML4, però reintroduit en l'HTML5.1 (still working draft).")}}. This document describes current Firefox implementation. Type 'list' is likely to change to 'toolbar' and 'context' to 'popup' according to HTML5.1 working draft.")}}</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories">Categories de contingut</a></th>
+ <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Contingut dinàmic</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">Contingut permès</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">Omissió de l'etiqueta</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Elements pares permessos</th>
+ <td>Qualsevol element que accepti <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">contingut dinàmic</a>.</td>
+ </tr>
+ <tr>
+ <th scope="row">Interfície DOM</th>
+ <td>{{domxref("HTMLMenuElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Atributs">Atributs</h2>
+
+<p>Aquest element inclou els <a href="/en-US/docs/Web/HTML/Global_attributes">atributs globals</a>.</p>
+
+<dl>
+ <dt>{{htmlattrdef("label")}}</dt>
+ <dd>The name of the menu as shown to the user. 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="Exemples">Exemples</h2>
+
+<h3 id="Exemple_1">Exemple 1</h3>
+
+<pre class="brush: html">&lt;!-- Un botó, que mostra un menú quan es clica --&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="Resultat">Resultat</h3>
+
+<p>{{EmbedLiveSample('Example_1', '', '', '', 'Web/HTML/Element/menu')}}</p>
+
+<h3 id="Exemple_2">Exemple 2</h3>
+
+<pre class="brush: html">&lt;!-- un menú de context per a un simple editor, que conté dos botons de menú --&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="Resultat_2">Resultat</h3>
+
+<p>{{EmbedLiveSample('Example_2', '', '', '', 'Web/HTML/Element/menu')}}</p>
+
+<h2 id="Especificacions">Especificacions</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificació</th>
+ <th scope="col">Estat</th>
+ <th scope="col">Comentaris</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>Definició inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}<sup>[1]</sup></td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}<sup>[1]</sup></td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] Gecko has some implementation, though it is not compatible to the specification. Vegeu <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1100749">error 1100749</a>.</p>
+
+<h2 id="Vegeu_també">Vegeu també</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>