orientation
摘要
此 orientation
CSS 描述符控制由@viewport
定义文档的方向。
通过设备的倾斜摆动情况来决定文档显示的方向,作者可以通过设置这个描述符来抑制方向的变化Value not found in DB!
语法
/* Keyword values */
orientation: auto;
orientation: portrait;/*锁定为纵向*/
orientation: landscape;/* 锁定为横向*/
取值
auto
- 用户代理将文档的方向设置为自动,通常基于设备的定位由加速度传感器 (如果设备具有这种硬件传感器),但是用户控制,OS 级别的"锁方向"往往会优先于加速度传感器的设置。
portrait
- 文档被锁定为纵向。
landscape
- 文档被锁定为横向。
标准语法
@viewport { <group-rule-body> }
规范
规范 | 标准 | 注释 |
---|---|---|
CSS Device Adaptation "orientation" descriptor |
Working Draft | Initial definition |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 未实现 | 未实现 | 10 -ms (en-US) | 未实现 | ? |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | ? | ? | ? | 8 -o (en-US) | ? |