orientation
CSS
descriptor
controls the orientation of a document defined by
@viewport
.
/* Keyword values */ orientation: auto; orientation: portrait; orientation: landscape;
For a UA/device where the orientation is changed upon tilting the device, an author can use this descriptor to inhibit the orientation change.
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.
| 相关 at-rule |
@viewport
|
|---|---|
| 初始值 |
auto
|
| 百分比 | refer to the size of bounding box |
| 计算值 | 如指定 |
auto | portrait | landscape
@viewport {
orientation: landscape;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Device Adaptation
The definition of '"orientation" descriptor' in that specification. |
工作草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
orientation
descriptor
|
Chrome 不支持 No |
Edge
不支持
12 — 79
Prefixed
|
Firefox 不支持 No |
IE
完整支持
10
Prefixed
|
Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No |
Opera Android
不支持
11.1 — 14
Prefixed
|
Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
要求使用供应商前缀或不同名称。