Why it matters
- A page that moves sideways under the thumb feels broken: while reading, it slides left and right, and part of it is out of view.
- Right-to-left pages are more exposed to it. A page can never be scrolled past its start edge, which is the left edge in left-to-right pages and the right edge in right-to-left ones. So an element hidden past the left edge, as left-to-right designs often hide a closed menu, stays hidden in English and becomes reachable in Arabic, and the page widens by that much.
- It often comes from a design written for left to right: positions such as
leftandmargin-leftthat were not mirrored when the page was flipped.
Example
.drawer { position: absolute; top: 0; left: -280px; width: 260px; }
.drawer { position: absolute; top: 0; inset-inline-start: -280px; width: 260px; }
How to fix
- Use logical properties such as
inset-inline-start,margin-inline-startandpadding-inline-end, which follow the direction of the page. An element placed past the start edge stays out of reach in both directions:
css
.drawer {
position: absolute;
inset-inline-start: -280px;
}- Hide a closed menu with the
hiddenattribute ordisplay: none, not by placing it off screen. - Keep wide content within the screen:
max-width: 100%for images and videos, and a container withoverflow-x: autoaround wide tables.
How we detect
- The rule applies to pages laid out right to left, by
diron<body>or on<html>, whose viewport meta setswidth=device-width, the sign of a page made for the phone's width. We render them 390 pixels wide. - When the page is wider than the screen, we list the elements that reach past its left edge, the side a right-to-left page scrolls towards. What lies past the right edge cannot be scrolled to, so it does not count. Elements inside another element that clips its content, and elements with a fixed position, do not count.
- There is one finding per element, with how far it reaches past the edge. When no element can be named, there is one finding for the page.