方向 | @viewport.orientation (Device Adaptation) – CSS 中文开发手册
orientationCSS描述符控制由@viewport所定义的文档的方向。
/* Keyword values */ orientation: auto; orientation: portrait; orientation: landscape;
对于倾斜设备时改变方向的UA /设备,作者可以使用此描述符来禁止方向更改。
|
Related at-rule |
@viewport |
|---|---|
|
初始值 |
auto |
|
百分比值 |
refer to the size of bounding box |
|
适用媒体 |
visual, continuous |
|
计算值 |
as specified |
|
规范顺序 |
the unique non-ambiguous order defined by the formal grammar |
语法
值
auto用户代理将自动设置文档的方向,通常基于由加速度计(如果设备具有这样的硬件传感器)确定的设备的方向,尽管经常有用户控制的OS级“锁定方向”设置将超过加速计读数。
portrait文档应该锁定在纵向方向上。
landscape文件应锁定在横向。
正式语法
auto | portrait | landscape
规范
|
Specification |
Status |
Comment |
|---|---|---|
|
CSS Device AdaptationThe definition of ‘”orientation” descriptor‘ in that specification. |
Working Draft |
Initial definition |
浏览器兼容性
|
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
|---|---|---|---|---|---|
|
Basic support |
No support |
No support |
10 -ms |
No support |
? |
|
Feature |
Android |
Chrome for Android |
Firefox Mobile (Gecko) |
IE Mobile |
Opera Mobile |
Safari Mobile |
|---|---|---|---|---|---|---|
|
Basic support |
? |
? |
? |
? |
8 -o |
? |
??本文标题:
方向 | @viewport.orientation (Device Adaptation) – CSS 中文开发手册 – Break易站 转载请保留页面地址:https://www.breakyizhan.com/css/32027.html