Skip to content
easeweb
Search topics

Pages locked to portrait or landscape

An orientation media query hides the page and asks people to turn their phone, or turns the page sideways, so it only works in the orientation its designers chose.

WCAG 2.2
SC 1.3.4AA· new in 2.1
Required by
EN 301 549 (EU)
Broken @media (orientation: landscape) and (max-height: 500px) { main { display: none; } }
The accessibility problem illustrated: Reach, strength:What if I can't turn it?
01

The problem

People whose phone or tablet is fixed in one position can't use a page that only works the other way round.

02

Try it

Order a flat white with the phone upright, then turn it on its side.

Use the switch to turn the phone. Imagine it is fixed in a mount and can only stay one way: can you still read the menu and press Add?

Broken Can you fix this?

Please turn your phone upright to use this site.

Order ahead

The phone is upright. Menu usable It works this way round. Turn the phone to see the other.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Delete the orientation lock and let the layout follow the width.

  1. 1Never hide, cover or turn the page in an orientation media query.
  2. 2Lay out by width, so both orientations get the same content and controls.
  3. 3Suggest a better orientation in a note people can dismiss, never in a message that replaces the page.
Before

The page hidden behind a message in landscape

<div class="turn-message">Please turn your phone upright to use this site.</div><main>…</main>
After One layout that follows the width
<main>…</main>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Verify the fix

5 checks, no mouse.

Test with: Touch, Zoom, Keyboard

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the site's layout or shared styles change.

Limits

This is a starting pattern, not a guarantee for every page. Some content does need one orientation, and the essential exception covers it, but only that part: the rest of the site still has to work both ways. A layout that passes 1.3.4 can still fail other criteria in landscape, such as text cut off at a short height or a focused control hidden under a sticky bar. Test the complete journey on the devices and mounts your users rely on.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work