<menu>

  • Revision slug: HTML/Element/menu
  • Revision title: menu
  • Revision id: 14132
  • Created:
  • Creator: Yann Dìnendal
  • Is current revision? No
  • Comment 22 words removed

Revision Content

The HTML menu element (<menu>) represents an unordered list of menu choices, or commands.

There is no limitation to the depth and imbrication of lists defined with the {{ HTMLElement("menu") }}, {{ HTMLElement("ol") }} and {{ HTMLElement("ul") }} elements.

Usage note: The {{ HTMLElement("menu") }} and {{ HTMLElement("ul") }} both represent an unordered list of items. They differ in the way that the {{ HTMLElement("ul") }} element only contains items to display while the {{ HTMLElement("menu") }} element contains interactive items, to act on.

Usage context

Content categories

flow content

If the element's type attribute is in the toolbar state: Interactive content.

Permitted content

Either: Zero or more {{ HTMLElement("li") }} elements.

Or: flow content.

Tag omission none, both the start tag and the end tag are mandatory
Permitted parent elements any element that accept flowing content
Normative document HTML5, section 4.11.46 ({{ HTMLVersionInline("4") }} : HTML4.01, section 10.2)

Attributes

Like all other HTML elements, this element supports the global attributes.

{{ htmlattrdef("type") }}
Used to indicate the kind of menu being declared. The values defined under HTML 5 are:
context
the commands of a context menu, and the user can only interact with the commands if that context menu is activated
toolbar
a list of active commands that the user can immediately interact with
list
an unordered list of items (each represented by an li element), each of which represents a command that the user can perform or activate, or, if the element has no li element children, flow content describing available commands

See also

  • Other list-related HTML Elements: {{ HTMLElement("ol") }}, {{ HTMLElement("ul") }}, {{ HTMLElement("li") }} and the obsolete {{ HTMLElement("dir") }}.

{{ HTML:Element_Navigation() }}

Revision Source

<p>The HTML <em>menu</em> element (<span style="font-family: Courier New;">&lt;menu&gt;</span>) represents an unordered list of menu choices, or commands.</p>
<p>There is no limitation to the depth and imbrication of lists defined with the {{ HTMLElement("menu") }}, {{ HTMLElement("ol") }} and {{ HTMLElement("ul") }} elements.</p>
<div class="note"><strong>Usage note: </strong> The {{ HTMLElement("menu") }} and {{ HTMLElement("ul") }} both represent an unordered list of items. They differ in the way that the {{ HTMLElement("ul") }} element only contains items to display while the {{ HTMLElement("menu") }} element contains interactive items, to act on.</div>
<h3>Usage context</h3>
<table class="fullwidth-table"> <tbody> <tr> <td><a href="/en/HTML/Content_categories" title="en/HTML/Content categories">Content categories</a></td> <td> <p><a href="/en/HTML/Content_categories#flow_content" title="en/HTML/Content categories#flow content">flow content</a></p> <p>If the element's <code>type</code> attribute is in the <code>toolbar</code> state: <a href="/en/HTML/Content_categories#Interactive_content" title="https://developer.mozilla.org/en/HTML/Content_categories#Interactive_content">Interactive content</a>.</p> </td> </tr> <tr> <td>Permitted content</td> <td> <p>Either: Zero or more {{ HTMLElement("li") }} elements.</p> <p>Or: <a href="/en/HTML/Content_categories#flow_content" title="en/HTML/Content categories#flow content">flow content</a>.</p> </td> </tr> <tr> <td>Tag omission</td> <td>none, both the <span title="syntax-start-tag">start tag</span> and the <span title="syntax-end-tag">end tag</span> are mandatory</td> </tr> <tr> <td>Permitted parent elements</td> <td>any element that accept flowing content</td> </tr> <tr> <td>Normative document</td> <td><a class=" external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#menus" rel="external nofollow" target="_blank" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#menus">HTML5, section 4.11.46</a> ({{ HTMLVersionInline("4") }} : <a class=" external" href="http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.4" title="http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.4">HTML4.01, section 10.2</a>)</td> </tr> </tbody>
</table>
<h3>Attributes</h3> <p>Like all other HTML elements, this element supports the <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>.</p> <dl> <dt>{{ htmlattrdef("type") }}</dt> <dd>Used to indicate the kind of menu being declared. The values defined under <a href="/en/HTML/HTML5" title="en/HTML/HTML5">HTML 5</a> are:</dd> <dl> <dt><code>context</code></dt> <dd>the commands of a context menu, and the user can only interact with the commands if that context menu is activated</dd> <dt><code>toolbar</code></dt> <dd>a list of active commands that the user can immediately interact with</dd> <dt><code>list</code></dt> <dd>an unordered list of items (each represented by an li element), each of which represents a command that the user can perform or activate, or, if the element has no li element children, flow content describing available commands</dd> </dl> </dl> <h3>See also</h3> <ul> <li>Other list-related HTML Elements: {{ HTMLElement("ol") }}, {{ HTMLElement("ul") }}, {{ HTMLElement("li") }} and the obsolete {{ HTMLElement("dir") }}.</li> </ul> <p>{{ HTML:Element_Navigation() }}</p>
Revert to this revision