ioscssmedia-queriesiphone-6iphone-6-plus

iPhone 6 and 6 Plus Media Queries


Does anyone know specific screen sizes to target media queries for iPhone 6 and 6 Plus?

Also, the icon sizes and splash screens?


Solution

  • iPhone 6


    iPhone 6+


    iPhone 6 and 6+

    @media only screen 
        and (max-device-width: 640px), 
        only screen and (max-device-width: 667px), 
        only screen and (max-width: 480px)
    { }
    

    Predicted

    According to the Apple website the iPhone 6 Plus will have 401 pixels-per-inch and be 1920 x 1080. The smaller version of the iPhone 6 will be 1334 x 750 with 326 PPI.

    So, assuming that information is correct, we can write a media query for the iPhone 6:

    @media screen 
        and (min-device-width : 1080px) 
        and (max-device-width : 1920px) 
        and (min-resolution: 401dpi) 
        and (device-aspect-ratio:16/9) 
    { }
    
    @media screen 
        and (min-device-width : 750px) 
        and (max-device-width : 1334px) 
        and (min-resolution: 326dpi) 
    { }
    

    Note that will be deprecated in http://dev.w3.org/csswg/mediaqueries-4/ and replaced with

    Min-width and max-width may be something like 1704 x 960.


    Apple Watch (speculative)

    Specs on the Watch are still a bit speculative since (as far as I'm aware) there has been no official spec sheet yet. But Apple did mention in this press release that the Watch will be available in two sizes.. 38mm and 42mm.

    Further assuming.. that those sizes refer to the screen size rather than the overall size of the Watch face these media queries should work.. And I'm sure you could give or take a few millimeters to cover either scenario without sacrificing any unwanted targeting because..

    @media (!small) and (damn-small), (omfg) { }
    

    or

    @media 
        (max-device-width:42mm) 
        and (min-device-width:38mm) 
    { }
    

    It's worth noting that Media Queries Level 4 from W3C currently only available as a first public draft, once available for use will bring with it a lot of new features designed with smaller wearable devices like this in mind.