Short answer
A hamburger menu is a compact button, commonly drawn as three stacked lines, that shows or hides a block of navigation links. The control is a button, not a decoration. MDN says an icon-only button has no accessible name until you add text. The WAI disclosure pattern sets aria-expanded to true or false and activates on Enter or Space. The links themselves belong in a nav element.
Last verified against the sources listed below.
Key takeaways
- The icon is the three-line mark. The control is a button that toggles navigation.
- Set type to button so the control does not submit a form by accident.
- Put a short text name in the button. MDN says visible text helps when the icon is unclear.
- Use aria-expanded, and optionally aria-controls, as the disclosure pattern describes.
- MDN recommends a target of at least 44 by 44 CSS pixels for the control.
What is hamburger menu? It is a website control: a button, usually drawn as three horizontal lines, that opens and closes the navigation. The lines are the icon.
The button is the thing people activate. The links sit in a nav element behind it.
Nothing on the pages used here assigns a click-rate percentage to that icon. The useful rules are the element, the accessible name, and the show-and-hide state.
What is the hamburger menu meaning?
The hamburger menu meaning is a compact switch for navigation, used when a full row of links would not fit or should stay out of the way.
MDN’s nav page says the element represents a section of navigation links, inside the current document or to other documents. Menus, tables of contents, and indexes are the examples. The implicit ARIA role is navigation.
The element has been available across browsers since July 2015. A document may contain several nav elements, and not every group of links needs one.
The button is separate from that section. The menu is the pattern of hiding the links until the button is used.
A nav that is always visible is still a nav. It is not a hamburger menu until a control toggles it.
What is the hamburger menu icon?
The hamburger menu icon is the stack of three lines that labels the button. The lines are a drawing, not an HTML element of their own.
MDN’s button page says buttons that only display an icon do not have an accessible name. The accessible name is what assistive technology reads.
Put text in the button that describes the action. The page notes that visible text helps people who do not recognize the icon, including people who read the symbol differently.
The same page says user agents style buttons as display: flow-root by default, which centers the contents. If you set the button to a flex or grid container, the children follow those rules instead. A shadow can suggest the control is pressable.
box-shadow adds offsets, blur, spread, and color around the box, and an inset shadow reads as pressed in. The property has been available since July 2015. A shadow does not name the button.
What is a hamburger menu in a website?
On a website, the hamburger menu is that button plus the navigation it reveals, usually in the header and often on a narrow viewport.
The HTML Standard lists the nav element as section 4.3.4. MDN’s page for the same element says the section holds navigation links, and that screen readers can use it to decide whether to skip navigation-only content at the start. Put the links in a list inside nav when they are a set of destinations.
The button can sit just outside that nav, or inside it, as long as the relationship is exposed.
Nielsen Norman Group’s flat-design article, dated September 27, 2015, says a fully flat interface drops the cues that used to show what can be clicked. The article does not give a hamburger statistic.
A three-line mark with no button border and no text is the kind of weak signifier that article warns about. A header position is a convention, not a substitute for a name.
What is a hamburger menu button?
The hamburger menu button is a real button that toggles the links. It is not a div with a click listener and no role.
The WAI disclosure pattern describes a button plus a section whose visibility the button controls. Enter and Space both toggle it when the control is focused. aria-expanded is true when the content is shown and false when it is hidden.
aria-controls can point at the container. One of the pattern’s examples is a navigation menu.
MDN says to set type="button" when the control should not submit a form. Otherwise a button inside a form submits and may load a response, which can wipe the page state. The recommended target size on that page is at least 44 by 44 CSS pixels, which helps touch and other imprecise pointers.
| Piece | Element or state | What the docs require |
|---|---|---|
| Icon | Often an SVG of three lines | Not a name by itself |
| Control | button type="button" |
Accessible name in the button text |
| Open or closed | aria-expanded |
true when shown, false when hidden |
| Links | nav, implicit role navigation |
A section of navigation links |
| Keys | Enter and Space | Both toggle, from the disclosure pattern |
How do you lay the bar out?
Use a row when the links are visible, and a column when the opened menu stacks. The button stays a button either way.
A simple header is a row: the name of the site, then the button, or the links when there is room. When the menu opens, the links can stack in a column under that bar.
Flexbox does that switch without inventing a new element. Keep the hit area at least 44 by 44 CSS pixels even when the icon art is smaller than the button.
Do not remove the text name when you switch to the icon. Hide it visually only if the CSS still leaves it in the accessibility tree.
Test the keyboard path: focus the button, press Enter, confirm aria-expanded flips, press Escape only if you added that behavior yourself. The disclosure pattern cited here specifies Enter and Space, not Escape.
Web design is the larger practice of laying out controls like this one.
Web accessibility covers names, roles, and keyboard behavior beyond this menu.
The Flexbox Playground lets you try a row or a column for the bar and copy the CSS. It does not write the button name or aria-expanded for you.
Frequently asked questions
Is the hamburger menu the same thing as the nav element?
No. The nav element is the section that holds the links. MDN says it represents a major block of navigation, with an implicit role of navigation, and that a page can contain more than one. The hamburger control is the button that shows or hides that section on a small screen. You can use a nav without a hamburger button, for example as a row of links that is always visible.
What text should the button use?
MDN says an icon-only button has no accessible name, so assistive technology has nothing useful to read. Put a short phrase in the button, such as Menu, that states what the control does. You can hide that text visually with CSS and keep it available to the accessibility tree. The same note says visible text helps people who do not know the icon.
Which keys should open and close it?
The WAI disclosure pattern says Enter and Space both activate the disclosure button when it has focus, and both toggle the panel. The element that shows and hides the content has role button. A native button already has that role. aria-expanded is true while the links are visible and false while they are hidden. aria-controls can point at the element that contains the links.
Should the button submit a form?
No, unless you truly mean to submit. MDN says a button associated with a form submits by default when type is missing or invalid. Set type to button so a press runs your script and does not send the form or load a new response. That matters when the menu button sits inside a form, which is easy to do by accident in a header. The script then only toggles the navigation.
Does a flat three-line icon stay understandable?
The icon is familiar to many people, and it is still a signifier you can weaken. Nielsen Norman Group's flat-design article says removing shadows and other cues makes it harder to see what can be clicked, and it does not publish a percentage for hamburger menus in the page opened here. Keep a visible name or a button shape, and meet the 44 by 44 CSS pixel target MDN recommends.
Sources
- The nav element · MDN, 2026
- The button element · MDN, 2026
- Disclosure pattern · W3C WAI, 2026
- HTML Standard, section 4.3.4 · WHATWG, 2026
- Flat design · Nielsen Norman Group, 2015
- box-shadow · MDN, 2026