Media queries for iPad vs iPad Air

10,535

you need viewport sizes http://viewportsizes.com/?filter=ipad Air has viewport 1024x768 too

Share:
10,535
Admin
Author by

Admin

Updated on June 05, 2022

Comments

  • Admin
    Admin almost 2 years

    There are 2 Good discussions about @media queries on StackOverflow already. One of them is here: CSS media queries work for iPad2, iPad Air, Samsung Galaxy, large screens but not the usual desktop screens.

    Those discussions took place before the advent of the iPad Air. The iPad Air has a viewport of 2048 x 1536. I cannot find the webkit-min-device-pixel-ratio for it. I want to target the Air specifically because my AJAX site shrinks to half the size on it. This site is meant for landscape only.

    So...

    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    (-webkit-min-device-pixel-ratio: 1.0)
    

    -> targets the old iPad 2's

    @media only screen 
    and (min-device-width : 768px) 
    and (max-device-width : 1024px) 
    (-webkit-min-device-pixel-ratio: 2.0)
    

    -> targets the iPad 3 & 4 retinas but it does not target the Air

    I have tried variations of

    @media only screen 
    and (min-device-width : 1536px) 
    and (max-device-width : 2048px) 
    and (-webkit-min-device-pixel-ratio: 2.0)
    

    to try and get the Air to react. Who out there has had experience developing for the new Airs?