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.
@media (orientation: landscape) and (max-height: 500px) { main { display: none; } } The problem
People whose phone or tablet is fixed in one position can't use a page that only works the other way round
A café's order-ahead page lists its drinks and food, each with a price and an Add button. Held upright, it works. Turn the phone on its side and the menu disappears: in its place, centred on a white screen, is "Please turn your phone upright to use this site." Nothing else on the page can be read or pressed until the phone is turned back.
The café also offers the page as an app: on an Android phone, people can install it to the home screen and open it like any other app. Its web app manifest sets the orientation to portrait, as many app templates do. Opened on a phone fixed on its side, in a mount on a wheelchair, the app doesn't turn with the phone. It stays drawn the way the phone is held upright, so to the person in front of it every line of the menu runs sideways, from the bottom of the screen to the top, and nothing on the page changes that.
Success criterion 1.3.4, Orientation, is level AA and was added in WCAG 2.1. Content must not restrict its view and operation to one display orientation, portrait or landscape, unless that orientation is essential. W3C names both forms here as failures: F100, a message asking people to reorient the device, and F97, restricting the view to a single orientation. The manifest's orientation member is that restriction: a browser that supports it shows the installed app in portrait whichever way the device is turned, and keeps it there on every page the app opens.
The criterion is about the page, not the person's own settings. Someone who has locked their phone's rotation has chosen an orientation, and a page without a lock follows it. The essential exception is narrow: the Understanding document's examples are a banking page that photographs a cheque, which is wider than it is tall, and a piano whose keys would be too small in portrait. "It looks best this way" is not essential, and neither is a design that was only ever drawn one way round.
Changes that come from the size of the screen are not covered either. A page that shows one column in portrait and two in landscape passes, because nothing is restricted: both views have the same content and controls.
Both locks reach only phones and tablets, which is exactly where the mounted devices are. The media query usually comes with a height limit, such as max-height: 500px, so it only fires on a phone. The manifest only applies once the site is installed, and only in browsers that support the member: Chrome, Samsung Internet and Firefox on Android do, Safari on iPhone and iPad doesn't. On the team's laptops, and on an iPhone, no one ever sees either lock.
3 of 10 groups affected
- No vision (not affected)
- Low vision (affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (affected)
- Reach, strength (affected)
- Cognitive (not affected)
- Seizures (not affected)
- Limited reach and strength People who can't hold a phone or turn it keep it in a mount on a wheelchair, a bed or a desk, fixed one way round. A page that only works the other way is closed to them, and asking them to turn it doesn't help.
- Limited manipulation People who use a switch or a head pointer often have the device mounted in front of them and set up once for them, so turning it means waiting for someone else to do it.
- Limited vision People with low vision often turn the phone on its side to get bigger text on a wider line, and in landscape the page is gone, or its text runs sideways.
A scanner loads the page once, in a browser tab at one window size, so it only meets one orientation, and the page works in that one. It never meets the manifest lock at all, because a browser applies the manifest only to the installed app. EaseWeb's audit renders each page in both orientations at phone size and reports content that one of them hides or covers, which finds the message; it doesn't read the manifest. axe's orientation rule looks only for a page turned sideways with a CSS transform, and it is experimental, not part of a standard run. A code assistant asked to "make the app portrait only" writes the very media query or manifest member that fails, and asked to fix 1.3.4 it sometimes softens the message's wording and leaves the page hidden.
What the checkers report
- axe DevTools
- CSS Media queries must not lock display orientation
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.
Broken Can you fix this?
Order ahead
The fix
Unlock the orientation, and let the layout follow the width
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.
<head> <link rel="manifest" href="/manifest.webmanifest"></head><body> <main>…</main></body>How it is fixed3 steps
- Remove the message and the orientation rules, so the page shows the same menu both ways round.
- Remove the manifest's
orientationmember. The installed app turns with the phone, and stays put when the phone's own rotation lock is on. - 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.
Keep orientation queries out of decisions about what is shown. If a layout really is better in one orientation, such as a wide seat map, there are ways to say so without locking.
- A suggestion: a short note, such as "Turn your phone for a bigger map", that people can dismiss, with the map still usable beneath it.
- Scrolling inside its own box: the map keeps its width and scrolls sideways within a frame people can reach and scroll with a keyboard, as pages that scroll sideways on a narrow screen describes.
- A control: a button that switches the part to a view that fits, such as a list of seats instead of the map. W3C's technique G214 describes this.
A phone in landscape is short: about 390 CSS pixels tall, less once the browser's own bars are drawn. A sticky header, a cookie banner and a bottom bar together can leave almost nothing of the page to read. That is not a lock, but it makes landscape unusable all the same. Let fixed bars scroll away, or shrink them, below a height of about 500 pixels.
Leave the manifest's orientation member out rather than setting it to any. Discourse's forum software removed the member in 2018 after people found that any made Chrome on Android ignore the phone's own rotation lock. Check the manifest a framework or a PWA plugin generates, not only the one in the repository, since the build may write the member in.
The same lock has two other forms. screen.orientation.lock() is usually allowed only on mobile devices and in full screen, so it turns up in games and video players; leave it out, or offer it as a choice people make. A page turned sideways with a CSS rotate transform inside an orientation media query is the third, and the one axe's orientation rule looks for.
Turning the phone fires resize, and some pages rebuild themselves on it. Keep what people typed, what they opened and where focus was when the orientation changes.
Verify the fix
5 checks, no mouse.
Test with: Touch, Zoom, Keyboard
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.
References
- WCAG Understanding: orientation (opens in a new tab)
- WCAG Technique F97 (opens in a new tab)
- WCAG Technique F100 (opens in a new tab)
- w3.org: b33eff (opens in a new tab)
- developer.mozilla.org: orientation (opens in a new tab)
- developer.mozilla.org: orientation (opens in a new tab)
- meta.discourse.org: 94900 (opens in a new tab)
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.