Developer tools
Dropdown Menu Generator
Utilities for code and web development.
Build site navigation from page names and links. Indent a line to turn it into a submenu item, then try the dropdowns in the live preview.
Choose a horizontal bar for your header or a vertical list for a sidebar. Adjust the background, text, highlight color, and corners, then check the menu at phone width.
Download a single HTML page, a ZIP with separate source files, or an HTML and JavaScript pair with styles bundled into the script. Files are generated in your browser.
Menu structure and appearance
Enter one item per line. Separate the label and URL with a | character. Indent two spaces for a submenu or four for a nested submenu.
Links are ordinary links by default. The rel="nofollow" attribute gives search engines a hint about following a link. Indexing of the destination is controlled on that page.
Live menu preview
Menu code and downloads
Add the menu to your website
Open the standalone HTML file to try the menu. To add it to an existing layout, unzip the source package, move the body markup into your header or sidebar, and keep the stylesheet and script references in the order shown in index.html.
Frequently asked questions
How do I style just one item?
In full mode, choose the item under Apply overrides to. Check the properties you want to change. For example, a link can have its own color and still use the font for its level. Clear a property to restore inheritance.
Can all submenu items use the same typeface?
Choose Level 2, check Font family, and select a typeface. Size, weight, and hover or focus effects can also be set by level. An item-specific setting takes precedence.
What does the nofollow setting do?
It adds rel="nofollow" to one link or to every link in the menu. It is off by default. Search engines may still discover the destination elsewhere. To exclude a page from search results, set noindex on the destination itself.
How do I create a dropdown?
Put the group label on its own line. Indent the links below it by two spaces.
Can I nest a list inside a dropdown?
Yes. Indent the section label by two spaces and its links by four. A menu can contain up to 120 items across three levels.
How can a dropdown link to its own landing page?
Add a URL to the group label. The label opens the dropdown, and the first link inside opens the landing page.
What kinds of links can I use?
Use web URLs, relative paths, page anchors, mailto: links, or tel: links. To jump to a section on the current page, use # followed by its element ID.
Which export works with JavaScript disabled?
Select HTML + CSS, no script. Download the standalone page or source ZIP. The dropdowns use native details and summary elements.
Which scripted version should I choose?
Choose HTML + CSS + JavaScript to include links in the original HTML. Choose Build menu with JavaScript to have the script create them. Both support Escape and click-away dismissal.
How can I test the menu on a small screen?
Select Phone width in the preview. The horizontal bar stacks vertically as the space available to the menu narrows.
Why do links stay in the preview?
The preview lets you test the dropdowns without leaving the editor. To follow links, open the downloaded HTML alongside the destination pages or on your site.
What comes in the source ZIP?
It contains index.html and menu.css. Scripted implementations also include menu.js. Keep the files together or update their paths in the HTML.
How do I install the two-file version?
Download HTML + JS with styles. Its menu.js inserts the stylesheet, and index.html shows where the script belongs.
How do I test keyboard navigation?
Use Tab to move between items. Enter follows a link. Enter or Space toggles a focused disclosure. In the scripted versions, Escape closes the group and focuses its label.