What is correct media query for IPad Pro?

前端 未结 8 1064
-上瘾入骨i
-上瘾入骨i 2020-12-23 09:32

I have these two but they are not working. I\'m simulating in Chrome

    /* Landscape*/

    @media only screen and (min-device-width: 1024px) and (max-devic         


        
8条回答
  •  攒了一身酷
    2020-12-23 10:18

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

    I don't have an iPad Pro but this works for me in the Chrome simulator.

提交回复
热议问题