<menu>...</menu>

HTML4 HTML5

Used to create custom lists of items constituting a menu or toolbar[cite: 3]. In modern HTML, it works almost identically to an unordered list <ul>, but carries additional semantic meaning – informing screen readers and browsers that the <li> elements inside represent a set of commands or selectable options[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Attributes: Universal attributes such as class, id, and style are mainly used[cite: 3].

Example 1

Code:

<menu> <li><button>Copy</button></li> <li><button>Paste</button></li> <li><button>Delete</button></li> </menu>

The browser will interpret this code as follows:

  • Example 2

    Code:

    <menu style="display: flex; gap: 10px; list-style: none; padding: 0; margin: 0;"> <li><button type="button">➕ New Document</button></li> <li><button type="button">💾 Save</button></li> <li><button type="button">🖨️ Print</button></li> <li><button type="button">⚙️ Settings</button></li> </menu>

    The browser will interpret this code as follows: