All specs
W3C Screen OrientationW3CShould KnowProduct

Screen Orientation API

Device Access & Sensors·World Wide Web Consortium
WHY YOU NEED THIS

Required for mobile games, video players, and apps that need landscape mode. Lock prevents disorienting rotation during gameplay or presentations. Understanding the fullscreen requirement for lock() prevents failures.

What It Defines

Defines screen.orientation for reading and locking screen orientation: type ('portrait-primary', 'landscape-primary', etc.), angle, and lock()/unlock() methods. The change event fires on orientation transitions.

Canonical (Normative)

Convenient (Practical)

orientationlandscapeportraitmobilescreenbrowser
Standards Body
World Wide Web Consortium

Publishes web platform specs including CSS, accessibility, security policies, Service Workers, Web App Manifest, and many browser APIs. Also maintains some versioned HTML/DOM specs.

Visit

Related Specs

WHATWG FullscreenWHATWGShould Know

Fullscreen

Required for video players, presentations, games, and immersive experiences. Understanding the security restrictions (user gesture required, no cross-origin iframes by default) prevents fullscreen request failures.

ProductDevice Access & Sensors
Details