首页 > 解决方案 > 横向媒体查询

问题描述

我有一个关于 lansdscape 位置的媒体查询 css 的问题。

当涉及到非常小的高度时,我确实很难做出完全负责任的项目,因为移动设备:375px、320px 等,此时一切都下降了。

包含所有这样的 Iphone 媒体查询是否正确?

   @media only screen 
   and (min-device-width: 375px) 
   and (max-device-width: 812px) 
   and (-webkit-min-device-pixel-ratio: 3)
   and (orientation: landscape),
   screen 
   and (min-device-width: 414px) 
   and (max-device-width: 736px) 
   and (-webkit-min-device-pixel-ratio: 3)
   and (orientation: landscape),
   screen 
   and (min-device-width: 375px) 
   and (max-device-width: 667px) 
   and (-webkit-min-device-pixel-ratio: 2)
   and (orientation: landscape),
   screen 
   and (min-device-width: 320px) 
   and (max-device-width: 568px)
   and (-webkit-min-device-pixel-ratio: 2)
   and (orientation: landscape),
   screen 
   and (min-device-width: 320px) 
   and (max-device-width: 480px)
   and (-webkit-min-device-pixel-ratio: 2)
   and (orientation: landscape) { }

标签: cssmedia-queries

解决方案


我很抱歉。看来我终于找到了适用于移动设备所有横向位置的媒体查询。

@media only screen 
  and (min-device-width: 280px) 
  and (max-device-width: 812px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: landscape){}

推荐阅读