XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / menu

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

menu

HTML 4.01 | HTML 5

<menu> ... </menu>

The element menu, deprecated in HTML 4.01, marks a menu list of one or more list items (li). Menus were intended for short lists of choices, such as links to other documents.

In HTML 5, menu represents a list of interactive options or commands, such as a menu of options in a web application.

Start/end tag

Required/required

Attributes

Core, internationalization, events, global HTML 5 attributes

  • compact (compact="compact" in XHTML)

    Deprecated. Not in HTML 5. Makes the list as compact as possible. Few browsers support this attribute.

  • label="Text"

    HTML 5 only. Defines a menu label displayed in nested menus.

  • type="context|toolbar"

    HTML 5 only. Defines the menu’s state. The value context indicates a context menu available only when specifically activated, for example by right-clicking. The value toolbar defines the menu as an immediately accessible toolbar. Without the attribute type, menu simply contains a list of commands.

Example (HTML 4.01)

<menu>
  <li>Über uns</li>
  <li>Neuigkeiten</li>
  <li>Blog</li>
  <li>Kontakt</li>
</menu>

Example (HTML 5)

<menu>
  <command onclick="cut()" label="Ausschneiden">
  <command onclick="copy()" label="Kopieren">
  <command onclick="paste()" label="Einfügen">
  <command onclick="delete()" label="Löschen">
</menu>

 

> back to the alphabetical list of elements

   

 

 

 

back to top