设备纵横比 | @media.device-aspect-ratio (Media Queries) - CSS 中文开发手册 - Break易站
2021-01-26 02:15
设备纵横比 | @media.device-aspect-ratio (Media Queries) - CSS 中文开发手册
@media.device-aspect-ratio
弃用
此功能已从Web标准中删除。虽然有些浏览器可能仍然支持它,但它正在被删除的过程中。如果可能,请避免使用它并更新现有代码;请参见兼容性表在这页的底部指导你的决定。请注意,此功能可能在任何时候停止工作。
device-aspect-ratio CSS @media媒体功能可基于输出装置的宽度与高度的纵横比来应用样式。
语法
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 | ? | ? | ? | ? | ? |
文章标题:设备纵横比 | @media.device-aspect-ratio (Media Queries) - CSS 中文开发手册 - Break易站
文章链接:http://soscw.com/index.php/essay/47075.html