Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

Summary

The orientation CSS descriptor controls the orientation of a document defined by @viewport.

For a UA/device where the orientation is changed upon tilting the device, an author can use this descriptor to inhibit the orientation change.

Related at-rule@viewport
Initial valueauto
Percentagesrefer to the size of bounding box
Mediavisual, continuous
Computed valueas specified
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

/* Keyword values */
orientation: auto;
orientation: portrait;
orientation: landscape;

Values

auto
The user agent will set the document's orientation automatically, typically based on the device's orientation as determined by an accelerometer (if the device has such a hardware sensor), although there is often a user-controlled, OS-level "Lock orientation" setting that will trump the accelerometer reading.
portrait
The document should be locked into portrait orientation.
landscape
The document should be locked into landscape orientation.

Formal syntax

auto | portrait | landscape

Specifications

Specification Status Comment
CSS Device Adaptation
The definition of '"orientation" descriptor' in that specification.
Working Draft Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported Not supported 10 -ms Not supported ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? 8 -o ?

ドキュメントのタグと貢献者

 このページの貢献者: mrenty, Sebastianz, fscholz, ndugger, cvrebert
 最終更新者: mrenty,