Element rotated by a quarter turn in one orientation only
orientation/locked
- WCAG success criterion
- 1.3.4 (level AA)
- Outcome class
- Automatic. An automated check that can report a confirmed violation.
- Area
- Accessibility, Structure & Semantics
- Default severity
- high
- axe-core rule
orientation/locked
Why we flag this
Users with fixed-mount screens (e.g. wheelchair-mounted) see the content sideways and cannot turn the device to read it.
rotate or a rotating transform under @media (orientation) differs by 90 degrees from the value in the other orientation.
What the rule checks
Scope. Rendered elements that a style rule under @media (orientation: landscape|portrait) gives the rotate property or a transform with rotate(), rotateZ(), rotate3d(), matrix() or matrix3d().
Expectation. Fails when the element's rotation about the Z axis in landscape differs from the one in portrait by a quarter turn (90 degrees modulo 180): the element turns back when the device turns and stays in place, so only one orientation shows it upright. Compared is the value that applies in each orientation (!important first, then the style attribute, then the last matching rule), including a rotation without a media query as the base (2.5deg, and 92.5deg in landscape, fails). A full turn, 45 degrees or the same quarter turn in both orientations passes. A rotation without an orientation media query applies in both and is not applicable, as are translations only, an invalid orientation value (the query is false) and inline styles set by script. Further media conditions next to the orientation, a selector this check does not decide or a value it cannot evaluate (var()) give a review, not a violation. Elements not rendered (display: none) are out of scope. Whether an orientation is essential is a human judgement. Reported once per element.
Source. WCAG 2.2 SC 1.3.4 Orientation; Media Queries 4 (orientation); CSS Transforms 1 and 2 (transform, rotate); ACT b33eff
Detection: shared; needs dom, stylesheets.
Failing example
The check reports a violation here. Corpus case visual_orientation_lock, element body. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page rotated into landscape on portrait screens</title>
<style>
body { color: #111111; background: #ffffff; }
/* Classic orientation lock: in portrait (the mobile pass) the whole page
is turned sideways so it can only be read in landscape. */
@media (orientation: portrait) {
body { transform: rotate(90deg); transform-origin: top left; }
}
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Seat map</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Choose your seat</h1>
<p>Rows A to F, seats 1 to 30.</p>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>Passing example
The check passes here and reports nothing. Corpus case visual_orientation_locked_ok. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rotations that keep both orientations usable</title>
<style>
body { color: #111111; background: #ffffff; }
.tile { display: inline-block; width: 120px; height: 120px; margin: 40px; }
.hidden { display: none; }
@media (orientation: landscape) {
/* A full turn leaves no rotation (ACT b33eff, Passed 1). */
#wheel { transform: rotateZ(1turn); }
/* 45 degrees is no quarter turn. */
#badge { transform: rotate(45deg); }
#stamp { transform: rotate(90deg); }
}
@media (orientation: portrait) {
/* The same quarter turn in both orientations locks nothing. */
#stamp { transform: rotate(90deg); }
/* Not rendered: out of scope. */
.hidden { transform: rotate(90deg); }
}
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Badge shop</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Badges</h1>
<div id="wheel" class="tile">Wheel</div>
<div id="badge" class="tile">Badge</div>
<div id="stamp" class="tile">Stamp</div>
<div class="hidden">Spare</div>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>This page is generated from the rule catalogue and the rule contracts; see therule overview for how the outcome classes are derived.