<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)