CSS参考手册
设备适配 | Device Adaptation
方向 | @viewport.orientation
orientation
CSS描述符控制由@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 |
? |
设备适配 | Device Adaptation相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。