English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML-Referenzhandbuch

HTML-Tagverzeichnis

HTML: <menu> Tag

HTML: Die <menu>-Marke definiert in einem HTML-Dokument eine unsortierte Menüliste. Dieser Tag wird auch als <menu>-Element bezeichnet.

Online-Beispiel

Beispiel für zwei Menü-Button-Serie-Optionen ("Datei" und "Bearbeiten"):

!doctype html
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 menu标签的使用(基础教程网 oldtoolbag.com)</title>
</head>
<body>
<menu type="toolbar">
  <li>
    <menu label="File">
      <button type="button" onclick="new()">New</button>
      <button type="button" onclick="save()">Save</button>
    </menu>
  </li>
  <li>
    <menu label="Edit">
      <button type="button" onclick="copy()">Copy</button>
      <button type="button" onclick="paste()">Paste</button>
    </menu>
  </li>
</menu>
</body>
</html>
Testen Sie heraus, ob es funktioniert ‹/›
In diesem HTML5In dem Dokumentbeispiel haben wir die <menu>-Marke mit dem Stil Werkzeugleiste verwendet, um eine unsortierte Menüliste zu erstellen. Die Werkzeugleiste enthält das "Datei"-Menü mit "Neu" und "Speichern" sowie das "Bearbeiten"-Menü mit "Kopieren" und "Einfügen".

Browser compatibility

IEFirefoxOperaChromeSafari

The <menu> tag is not supported by mainstream browsers at present.

Tag definition and usage instructions

The <menu> tag defines a command list or menu.

The <menu> tag is usually used for text menus, toolbars, and command list options.

The <menu> tag is composed of <li> tags.

You can nest <ol>, <ul>, and <menu> lists.

Hints and Notes

Hint: Use CSS to define the menu list style.

HTML 4.01 and HTML5differences between

HTML 4.01The <menu> element is deprecated.

HTML5 The <menu> element has been redefined in the middle.

Attribute

AttributeValueDescription
labelHTML5textDescription of the menu item's marker.
typeHTML5context
toolbar
list
Description of the menu type. The default is "list".

global attributes

<menu> Tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<menu> Tag supports all HTML Event Attributes.