iPad Pro 12.9的横向媒体查询无法正常工作

时间:2018-03-09 14:07:12

标签: css

我使用了以下媒体查询CSS代码,但在iPad Pro 12.9中它不能以某种方式工作。以下是代码:

/* Landscape */
@media only screen
   and (min-device-width : 1024px)
   and (max-device-width : 1366px)
   and (orientation : landscape) {
}

/* Landscape */
@media only screen
   and (min-device-width: 1024px)
   and (max-device-width: 1366px)
   and (orientation: landscape)
   and (-webkit-min-device-pixel-ratio: 1.5) {
}

/* Landscape */
 @media only screen and (min-device-width: 1366px) 
     and (max-device-height: 1024px) 
     and (-webkit-min-device-pixel-ratio: 2) 
     and (orientation: landscape) {
}

我已经提到了以下解决方案,但不知何故它对我不起作用。

有人可以帮我在这里使这款iPad Pro 12.9英寸有效吗?

1 个答案:

答案 0 :(得分:0)

试试这个

/* Portrait */
@media only screen 
  and (min-device-width: 1024px) 
  and (max-device-width: 1366px) 
  and (orientation: portrait) 
  and (-webkit-min-device-pixel-ratio: 1.5) {
}

/* Landscape */
@media only screen 
  and (min-device-width: 1024px) 
  and (max-device-width: 1366px) 
  and (orientation: landscape) 
  and (-webkit-min-device-pixel-ratio: 1.5) {

}