A landscape phone compresses vertical space to roughly 320–430 CSS pixels, so a menu that drops down from a top bar can push content off-screen or force awkward scrolling. The reliable fix is to treat mobile landscape as its own layout regime: keep the primary navigation visible in a horizontal bar when it fits, and switch to an off-canvas drawer or modal sheet that scrolls internally when it doesn't. The key condition is viewport height, not width—(orientation: landscape) and (max-height: ...) is the media feature that decides which pattern you get.

Below is a complete, ordered approach: the structural HTML first, then the CSS cascade with landscape rules layered last, then a small amount of JavaScript for focus management and toggle behavior. Everything uses standard, stable web platform features current as of late 2026.

Why landscape phones break ordinary menus

Most responsive navigation tutorials key off max-width, which models a portrait phone as "narrow" and a landscape phone as "wide enough." On a 390×844 phone rotated sideways, the viewport is 844×390. A @media (max-width: 600px) rule no longer matches, so the desktop-style horizontal menu appears—but only 390 CSS pixels of height remain, minus browser chrome. A menu with eight links at 44 pixels each needs 352 pixels plus padding, which crowds or overflows the viewport, and any dropdown escapes below the fold.

There are three overlapping constraints to design around:

Vertical budget. iOS Safari and Chrome on Android both consume viewport height with their browser UI. The 100vh unit historically overstated the available height on mobile; the newer svh, lvh, dvh units address this, and dvh tracks the dynamic toolbar state. Touch targets. Anything tappable should be at least 44×44 CSS pixels (Apple's guidance) or 48×48 (Material), with spacing between targets. Horizontal rows satisfy this easily; dense vertical stacks in a short viewport do not. Safe areas. Notched phones in landscape put the cutout on a side, so horizontal padding needs env(safe-area-inset-left) and env(safe-area-inset-right), not just the bottom.

A menu that works in portrait but fails in landscape usually fails because the author never tested the rotated state, not because the CSS is wrong in isolation.

Prerequisites before you write any CSS

Two setup steps make the rest predictable.

First, include the viewport meta tag with viewport-fit=cover so safe-area insets are exposed on notched devices: .

Second, decide the breakpoint logic. I recommend combining width and height rather than using orientation alone, because orientation: landscape also matches desktop monitors and tablets, where you don't want mobile behavior. A practical test is "is this a short viewport?"—something like (max-height: 500px) captures rotated phones and small landscape tablets while leaving laptops alone.

Third, plan your markup so the same DOM serves both modes. Duplicating the menu in HTML and hiding one copy creates accessibility problems (hidden duplicates still get announced if hidden incorrectly) and maintenance drift.

Step 1: Write one semantic navigation structure

Build a single with a list, a toggle button, and a container that the CSS can restyle. The toggle button is hidden by default and only revealed in the compact layout.

The aria-expanded attribute is the contract between CSS and assistive technology: it announces whether the menu is open, and you must keep it synchronized with the visual state. aria-controls points at the element being toggled. Use type="button" so the control doesn't accidentally submit a form if the header sits inside one.

If your menu has submenus, nest them as inside and give the parent link or a separate button aria-expanded and aria-haspopup="true". In landscape, submenus are better rendered as accordions inside the drawer (expand in place and scroll) than as hover flyouts, because horizontal flyouts run out of screen width quickly.

Step 2: Build the mobile-first base styles

Write the compact layout first; it's the one most phones will use in portrait, and landscape inherits it. The essential pieces: a scrollable nav panel, generous tap targets, and internal scrolling so long menus never trap the user.

Several details matter here. max-height uses 100dvh, the dynamic viewport unit, so the menu shrinks when the browser toolbar appears rather than extending underneath it. overscroll-behavior: contain stops scroll chaining—when the menu reaches its end, further swipes won't scroll the page behind it, which is a common source of disorientation on touch devices. inset-inline respects writing direction. And the desktop override requires both width and height, which is the whole point: a wide-but-short landscape phone will not match min-height: 40rem.

The fallback for browsers without dvh is a max-height: calc(100vh - 3.5rem) declaration immediately before the dvh line; unknown units cause the older declaration to win.

Step 3: Add the landscape-specific regime

Now layer landscape rules. The goal: if the handful of top-level links fit in one horizontal row with adequate targets, show them inline and hide the toggle—even on a phone. Otherwise, keep the drawer but make it a full-height side or full-screen sheet with tight vertical rhythm.

Two judgment calls are embedded there. First, the side sheet uses position: fixed and 100dvh height with internal overflow-y: auto, so a long menu scrolls within the sheet while the page behind stays put. Second, the tap target drops to 40 pixels—below the 44-pixel ideal—because vertical space is genuinely scarce and the rows are wide (full sheet width), so horizontal error tolerance compensates. If your audience includes users with motor impairments, keep 44 pixels and accept fewer visible items with scrolling.

A different, often better option for landscape phones when all links fit: render the bar inline and shrink the targets horizontally rather than vertically.

Which pattern to choose? Use the inline bar when you have roughly five or fewer short labels (avg. 6 characters) across an 844-pixel-wide viewport; that fits comfortably at 44 pixels tall. Use the side sheet when labels are long, counts are higher, or any item opens a submenu. The comparison is about the same criteria—target size, items visible without scrolling, and horizontal fit—under identical 844×390 conditions, not about which one "looks modern."

Condition (landscape phone, ~844×390) Inline bar Side sheet Dropdown panel
Items visible at once All, if ≤5 short 6–10 with scroll 3–5, then scroll
Minimum target easily kept Yes (44 px tall) Yes Tight vertically
Submenus Flyouts overflow Accordion inside Accordion inside
Page content retained Fully Mostly (sheet covers ~22rem) Hidden behind panel
Best when Few short links Many links/account items Quick, rarely used menus

Step 4: Wire up the toggle with minimal, correct JavaScript

CSS can't reliably synchronize aria-expanded and a data attribute, so use a short script. Keep it defensive: the page should still be usable if the script fails (that's why the base CSS shows the toggle and hides the nav only when script runs—or you accept a no-JS fallback by leaving the nav visible).

Focus handling is the part most tutorials skip. Moving focus into the nav on open and back to the toggle on close keeps keyboard and switch-control users oriented; without it, focus stays on a button that's now visually behind a sheet. If you use the side sheet, also trap Tab focus inside it—a few lines testing whether the next tabbable element is outside the sheet and wrapping to the first item inside—or use the native element with showModal(), which traps focus and handles Escape for you. Native is well supported and is worth considering for the full-screen variant.

Rotation is the failure case to handle explicitly: a user opens the drawer in portrait, rotates, and the desktop media query now matches while data-open="true" and aria-expanded="true" linger. The matchMedia change listener above fixes it. Conversely, if you don't use a media query listener, you can add a resize handler that calls setOpen(false) whenever the desktop query matches—simpler, slightly noisier.

Step 5: Verify success and know when to stop

You can check the implementation without a physical rotation in most browsers: open DevTools, toggle the device toolbar, pick a phone preset, and press the rotate button. Confirm these behaviors in order:

1: At 844×390, the header, menu control, and content are all reachable without horizontal scrolling. 2: Opening the menu shows all items via internal scroll; the page behind doesn't scroll when you swipe inside the menu. 3: With the menu open, pressing Escape closes it and focus returns to the toggle. 4: Tabbing through the open menu stays inside it (if you built a trap) and every focused link is visible. 5: Rotating to portrait and back, or resizing to a laptop width, closes the menu and resets aria-expanded to false. 6: On a notched-device emulation (e.g., iPhone 14 Pro landscape), text doesn't sit under the cutout—check env(safe-area-inset-left) padding.

If any of these fail, the symptom usually maps to a specific cause: content cut off at the bottom means you used 100vh instead of 100dvh or forgot overflow-y: auto; swipe bleeding into the page means overscroll-behavior is missing; the menu vanishing mid-rotation means the matchMedia reset isn't wired. Those are all reversible CSS/JS checks.

Stop and consult a professional—an accessibility specialist or the framework maintainers—if your menu must satisfy a formal conformance audit (WCAG 2.2 AA, for instance) and you find focus-order or announcement failures you can't reproduce and fix yourself. That's a genuine signal that the interaction model, not just the CSS, needs review.

Edge cases and limits worth planning for

The svh/lvh/dvh distinction matters more in landscape than portrait because the browser toolbar occupies a larger fraction of a 390-pixel height. dvh is the right default for full-height sheets; svh (smallest viewport) is safer if you must guarantee content is visible when toolbars are expanded. Don't mix them within one layout without a reason.

Hover-based flyout submenus have no place on touch. If your desktop design uses hover, gate it behind @media (hover: hover) and (pointer: fine) and provide a click/tap-driven accordion for coarse pointers; landscape phones are coarse pointers even though their width resembles a tablet.

Reduced motion deserves a line: wrap the sheet's transition in @media (prefers-reduced-motion: no-preference) so users who've disabled animation get an instant open. And if the menu is the only navigation, ensure the toggle is reachable by keyboard from the very first Tab press—it should be the first or second focusable element in the header, not buried after a long logo link list.

Finally, remember that "landscape" on a foldable or a tablet in a keyboard case behaves the same way: short and wide. The height-based breakpoint you wrote for phones will also serve those, which is a feature, not a bug.

The finished pattern is deliberately boring: one DOM, a cascade where landscape rules come last, dynamic-height units for the scroll container, synchronized ARIA state, and rotation handled explicitly. That combination is what keeps the menu usable when the phone is turned sideways—and it's testable in a browser in a few minutes.