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

比率 | <ratio>

<ratio>CSS数据类型,用于描述媒体查询的纵横比,表示两个无单位值之间的比例。

语法

比率由的组成为:严格的正数 <integer>,以及后面斜杠 ('/', Unicode U+002F SOLIDUS),和后面第二个严格的正数 <integer>

斜杠前后的空格是可选的。第一个数字代表宽度,第二个数字表示高度。

实例

?

Ratio

Usage

?

4/3

Traditional TV format in the 20th century.

?

16/9

Modern "widescreen" TV format.

?

185/100 = 91/50 (non-integer dividends and divisors are not allowed)

The most common movie format since the 1960s.

?

239/100 (non-integer dividends and divisors are not allowed)

"Widescreen", anamorphic movie format.

规范

Specification

Status

Comment

Media QueriesThe definition of '<ratio>' in that specification.

Recommendation

Initial definition.

浏览器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari (WebKit)

Basic support

(Yes)

3.5 (1.9.1)

9

9.5

(Yes)

Feature

Android

Firefox Mobile (Gecko)

IE Phone

Opera Mobile

Safari Mobile

Basic support

(Yes)

(Yes)

?

(Yes)

(Yes)

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com