设备纵横比 | @media.device-aspect-ratio (Media Queries)

  •   CSS 中文开发手册

    设备纵横比 | @media.device-aspect-ratio (Media Queries) - CSS 中文开发手册

    @media.device-aspect-ratio

    弃用

    此功能已从Web标准中删除。虽然有些浏览器可能仍然支持它,但它正在被删除的过程中。如果可能,请避免使用它并更新现有代码;请参见兼容性表在这页的底部指导你的决定。请注意,此功能可能在任何时候停止工作。

    device-aspect-ratio CSS @media媒体功能可基于输出装置的宽度与高度的纵横比来应用样式。

    语法

    device-aspect-ratio功能被指定为一个 <ratio>。这是一个范围功能,也就是说,您也可以使用前缀min-device-aspect-ratio和max-device-aspect-ratio变量分别查询最小值和最大值。

    例子

    article {
      padding: 1rem;
    }
    
    @media screen and (min-device-aspect-ratio: 16/9) {
      article {
        padding: 1rem 5vw;
      }
    }

    规范

    Specification

    Status

    Comment

    Media Queries Level 4The definition of 'device-aspect-ratio' in that specification.

    Working Draft

    Deprecated in Media Queries Level 4.

    Media QueriesThe definition of 'device-aspect-ratio' in that specification.

    Recommendation

    Initial definition.

    浏览器兼容性

    Feature

    Chrome

    Firefox (Gecko)

    Internet Explorer

    Opera

    Safari

    Basic support

    ?

    ?

    ?

    ?

    ?

    Feature

    Android

    Firefox Mobile (Gecko)

    IE Mobile

    Opera Mobile

    Safari Mobile

    Basic support

    ?

    ?

    ?

    ?

    ?

  •   CSS 中文开发手册
    转载请保留页面地址:https://www.breakyizhan.com/css/32291.html
    原文地址:https://www.cnblogs.com/breakyizhan/p/13233374.html