首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

方向 | @viewport.orientation

orientationCSS描述符控制由@viewport所定义的文档的方向。

代码语言:javascript
复制
/* 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文件应锁定在横向。

正式语法

代码语言:javascript
复制
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

?

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com