October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Pure CSS Dropdown Menus: Build One and Know Its Limits

A CSS-only dropdown can reveal nested navigation on hover and keyboard focus, but touch behavior, state announcement, and Escape dismissal may call for another pattern.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can reveal a nested navigation list with CSS alone: hide it by default, then show it when its parent is hovered or contains keyboard focus. Add :focus-within alongside :hover so keyboard users can reach the submenu. This is a simple pattern for ordinary site navigation, but it does not provide every interaction feature a menu may need—especially reliable tap behavior, an announced open state, or Escape-key dismissal.

How a pure CSS dropdown works

Place the submenu inside its parent navigation item. CSS can then use the parent’s hover or focus state to reveal the nested list. The submenu needs a positioning context and can be positioned over the page rather than taking up space in the navigation row.

As an Amazon Associate I earn from qualifying purchases.

This example uses semantic navigation, nested lists, and links. The submenu is revealed by either pointer hover or focus anywhere inside the parent item:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<nav aria-label="Main">
  <ul class="nav-list">
    <li class="nav-item">
      <a href="/products/">Products</a>
      <ul class="submenu">
        <li><a href="/products/phones/">Phones</a></li>
        <li><a href="/products/tablets/">Tablets</a></li>
      </ul>
    </li>
    <li><a href="/about/">About</a></li>
  </ul>
</nav>
.nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  min-width: 12rem;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  background: white;
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 15%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.25rem);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
}

.nav-item:hover > .submenu,
.nav-item:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-list a {
  display: block;
  padding: 0.65rem 0.8rem;
}

.nav-list a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

The :focus-within selector matters: focus moves from the top-level link into the submenu as someone tabs through it. If the submenu opens only while the top-level link itself has focus, it may disappear as soon as focus advances to a child link. Keep the submenu inside the parent item so the parent remains focused-within during that movement.

#1 Best Overall
Cinnvoice 12 Pcs Restaurant Menu Covers 8.5 x 11 Inch Book Style 3 Page 6 View PVC Transparent Restaurant Menu Holder Book for Cafe Bar Hotel, Black
  • Quality Material: our menu cover is made of quality PU leather, PVC and hard metal at the four corners, we only use quality materials to ensure the wear resistance and durability of the menu cover; Our leather menu holder has no bad smell and soft feel, sturdy and durable
  • Reasonably Sized for Easy Use: quickly and easily load menus or papers from the side and get started; Each cover has 3 pages, 6 views, and 8.5 x 11 inches pages fit paper sizes up to A4
  • Visual Design: adopts transparent cover to clearly display the restaurant menu while keeping it clean and protected, so it can remain neat and easy to use even with frequent and continuous use
  • Exquisite and Stylish: useful and luxurious design, with PU leather trim sewn on each edge and elegant metal decoration on all corners, adding charm to your menu
  • Widely Application: our restaurant menu holder allow guests to view the menu conveniently and keep the menu clean from frequent use, ideal for restaurants, hotels, cafes, restaurant, bars, etc

Opacity alone is not enough to hide a closed submenu: an invisible panel can still intercept pointer input. Pairing opacity with visibility prevents that. The small translateY() transition is optional visual polish; it is not required for the interaction.

Keyboard, touch, and accessibility limits

Keyboard access is not the same as complete menu behavior

With :focus-within and visible focus styling, keyboard users can reveal and follow submenu links. CSS alone cannot dynamically update aria-expanded to reflect whether the submenu is open, or implement an Escape-key action to close it. Those limitations matter more for controls that need an explicit, announced open state or application-style keyboard behavior than for a basic navigation list.

Rank #2
FLKQC Restaurant Menu Covers Holders 8.5 X 11, 5 Pack 2 View Synthetic Leather Menu Holder Covers Book Style with Angled Corners Black for Wine List, Certificate Organizer Diploma Holder (2 Page)
  • Perfect Size & Classic Design: Each leather menu cover measures 9.2" x 11.45", perfectly fitting 8.5" x 11" menus. Designed with double foldable panels, 2-view style, it allows you to change menus quickly and conveniently. The timeless classic look helps your restaurant, café, bar, or hotel stand out and leaves customers with a professional impression.
  • Premium PU Leather & Durable Construction: Crafted from high-quality PU leather, these menu covers are water-resistant, wear-resistant, and built to last. The reinforced sealed edges prevent fraying or cracking, ensuring durability even with daily use in busy restaurants and bars.
  • Easy to Clean & Maintain: Simply wipe with a damp cloth to keep the restaurant menu holder clean and looking new. Unlike glass or plastic menu sleeves, our PU leather menu protector is non-toxic, eco-friendly, and non-shattering, making it both safe and practical for long-term use.
  • Elegant & Professional Presentation: Whether you’re running a fine dining restaurant, steakhouse, café, bistro, or hotel lounge, this leather menu holder instantly upgrades your service style. It highlights your dishes in a refined way, enhancing your brand image and creating a better dining experience.
  • Value Pack – Set of 5 Menu Covers: Each package includes 5 × 8.5" x 11" double foldable panel leather menu covers (2 View). Perfect for restaurants, bars, and catering businesses that need multiple menu displays. Great for presenting food menus, wine lists, cocktail lists, or drink specials.

Use a labeled <nav> with nested lists and anchors for ordinary site navigation. Do not add role="menu" simply because a list visually drops down: application menus have different semantics and keyboard expectations. WAI distinguishes those patterns in its menus tutorial.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Hover is unreliable as a tap interaction

Touch devices do not handle :hover consistently. A hover-only submenu can be awkward or inaccessible on phones. If visitors need to open it with a tap, choose a click/tap disclosure pattern or make submenu destinations available through another direct route—for example, listing those destinations on the parent page. W3C WAI notes that people with reduced dexterity may have difficulty operating fly-out menus; its fly-out menu guidance discusses ways to reduce that barrier.

Meet the hover-and-focus content requirements

WCAG 2.2 Success Criterion 1.4.13 applies when hovering or keyboard focus causes additional content to appear and then disappear. The content must be Dismissible, Hoverable, and Persistent, subject to the criterion’s exceptions. In practical terms, a user should be able to move the pointer onto the submenu without it vanishing; the revealed content should remain until hover or focus is removed, the user dismisses it, or the information is no longer valid; and it should be dismissible without moving pointer hover or keyboard focus unless an exception applies. Assess the actual menu against the criterion rather than assuming that opening it on focus is sufficient. See the W3C explanation of SC 1.4.13.

Make the menu usable at different sizes and zoom levels

Provide enough spacing and padding for small touch targets and users with reduced dexterity. Ensure text remains readable when enlarged, the menu does not overlap or become unusable at zoom, and hover and keyboard focus have clear visual feedback. Do not use color alone to indicate the current or active item. For sites with multiple navigation regions, give each one a descriptive label, and preserve the same items, wording, and destinations across responsive layouts. WAI’s menu structure guidance and styling guidance cover these practices.

Rank #4
FLKQC 3 Pack Menu Covers 8.5" x 11" Menu Holder, Double Stitched Menu Covers, Restaurant Menu Cover, Single Page Menu Cover Two Clear Viewing Surfaces (Book Style)
  • Durable Construction: FLKQC Menu Covers are made from transparent flexible PVC that is non-shattering, non-toxic, and pollution-free, ensuring long-lasting use.
  • Elegant Design: Each clear protective menu book is meticulously sewn with leatherette trim and adorned with elegant gold metal corners for a sophisticated look.
  • Optimal Capacity: Each menu cover features 3 pages with 6 clear views, designed to accommodate standard letter-size paper (8-1/2" x 11"). Easily accepts 8.5 x 11 inch standard size paper. Actual size 8.6 x 11.3 Inches. Single Page: 2 Views.
  • Convenient Package: Each package includes 3 pieces of 3-page menu covers (Book Style), ideal for home use and restaurants' play menus. (Menus shown in pictures are NOT included.) To maintain pristine condition, PVC covers are protected with a film during transportation. Please remove the film from the edges before use for a clearer appearance.
  • 3-Page 6-View Restaurant Menus Folder: Perfect for restaurants, hotels, cafes, porterhouses, nosherys, pubs, bars, and more.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When CSS alone is the right choice—and what to use otherwise

Choose based on how people should activate the submenu, what state and dismissal behavior the interface requires, whether it is navigation or an application menu, and which browsers the project supports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Pattern Activation and state Practical fit
CSS :hover plus :focus-within Pointer hover and keyboard focus reveal a nested submenu; CSS does not manage scripted state. Simple site navigation where hover/focus reveal is suitable. Touch behavior varies, and CSS does not synchronize aria-expanded or add Escape dismissal.
<details> and <summary> Native disclosure toggled open or closed by activating a summary label. Consider when click/tap disclosure is desired. MDN describes <details> as widely available across browsers since January 2020. It is a disclosure widget, not automatically a full application menu.
Popover API Browser-managed popover controlled through HTML attributes or JavaScript. MDN labels the API Baseline 2025, available in latest devices and browsers since January 2025, but cautions it may not work in older browsers or devices. Check your project’s browser floor.
Scripted navigation disclosure Can manage open state, aria-expanded, dismissal, and tailored keyboard and touch behavior. Use when explicit state or keyboard behavior is required; design and test it against WAI guidance.

References: MDN on <details> and the Popover API.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.