Skip to content
easeweb
Search topics

Pages locked to portrait or landscape

Turned sideways, the page is hidden behind "Please rotate your device", or the web app's manifest holds it upright, so it works only one way round.

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

  • Broken 1: turn the phone on its side. Imagine it is fixed in a mount and can only stay that way: can you still read the menu and press Add? Turn it with Upright and On its side, below.

  • Broken 2: the page is installed as an app, locked to portrait. Turn the phone on its side, as a mount might hold it. Does the menu turn with it, and can you still read it and press Add?

  • Apply the fix. Order with the phone upright and on its side, and see how the menu fits each way round.

Simulate Phone orientation

Broken Can you fix this?

Please turn your phone upright to use this site.

Order ahead

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Unlock the orientation, and let the layout follow the width

Before

The page hidden behind a message in landscape

<head>  <link rel="manifest" href="/manifest.webmanifest"></head><body>  <div class="turn-message">Please turn your phone upright to use this site.</div>  <main>…</main></body>
What is wrong2 points
  • On a phone held sideways, the media query hides the whole menu.
  • It shows only the request to turn the phone, so a person who can't turn it can't order.
After
FixOne layout that follows the width
<head>  <link rel="manifest" href="/manifest.webmanifest"></head><body>  <main>…</main></body>
How it is fixed3 steps
  1. Remove the message and the orientation rules, so the page shows the same menu both ways round.
  2. Remove the manifest's orientation member. The installed app turns with the phone, and stays put when the phone's own rotation lock is on.
  3. Lay the menu out on a grid that follows the width. In landscape the phone is wider, so the grid fits two columns; in portrait it fits one.

This fixes both Befores and passes 1.3.4, in a browser tab and as an installed app. The layout responds to the space it has, which is what an orientation query was standing in for, and it also works in a narrow window on a desktop or a split screen on a tablet, where orientation says nothing useful.

HTML and ARIA
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.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service