{"id":1109,"date":"2012-09-25T12:43:11","date_gmt":"2012-09-25T19:43:11","guid":{"rendered":"http:\/\/zsprawl.com\/iOS\/?p=1109"},"modified":"2012-09-25T12:51:11","modified_gmt":"2012-09-25T19:51:11","slug":"css-media-queries-for-the-iphone-5","status":"publish","type":"post","link":"http:\/\/zsprawl.com\/iOS\/2012\/09\/css-media-queries-for-the-iphone-5\/","title":{"rendered":"CSS Media Queries for the iPhone 5"},"content":{"rendered":"<p>I&#8217;ve recently been getting back into iPhone development with the iPhone 5&#8217;s new screen and the need to update some of my Apps for the new phone and operating system. As you probably already know, the new 4-inch screen is yet another set of dimensions programmers needs to take into account. The new screen is 1136 pixels wide by 640 pixels in portrait mode. So far I&#8217;ve had great luck with the following CSS Media Query for my Portrait only apps, which uses 568px as the fixed device height (times 2.0 pixel ratio equals the 1136px across).<\/p>\n<p>[code]@media screen and (device-height: 568px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {<br \/>\n    \/\/ css here<br \/>\n}[\/code]<\/p>\n<p>This works well mostly because of the <em>-webkit-min-device-pixel-ratio<\/em> parameter, which detects the retina display in accordance with the higher resolution. <\/p>\n<p>Let me know below what you are using!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve recently been getting back into iPhone development with the iPhone 5&#8217;s new screen and the need to update some of my Apps for the new phone and operating system. As you probably already know, the new 4-inch screen is yet another set of dimensions programmers needs to take into account. The new screen is <a href=\"http:\/\/zsprawl.com\/iOS\/2012\/09\/css-media-queries-for-the-iphone-5\/#more-'\" class=\"more-link\"><br \/>more \u00bb<\/a><\/p>\n","protected":false},"author":318,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,38,43,25],"tags":[36,6,126],"class_list":["post-1109","post","type-post","status-publish","format-standard","hentry","category-blog","category-cordova","category-css","category-jquery-mobile","tag-css3","tag-iphone","tag-javascript"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1109"}],"collection":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/users\/318"}],"replies":[{"embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/comments?post=1109"}],"version-history":[{"count":5,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1109\/revisions"}],"predecessor-version":[{"id":1113,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/posts\/1109\/revisions\/1113"}],"wp:attachment":[{"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/media?parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/categories?post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zsprawl.com\/iOS\/wp-json\/wp\/v2\/tags?post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}