I am trying to implement alternative layouts for both iPad / iPhone and older iPhone.
I found that the best method is to use @media from the CSS3 specification.
As such, these are my media queries per minute:
@media screen and (max-width: 1000px) { ... }
Above is for small screens for desktops and laptops.
@media screen and (max-width: 700px) { ... }
Above for iPad and VERY small screens for desktops / laptops.
@media screen and (max-device-width: 480px) { ... }
Above for iPhone 3GS and mobile devices in general.
However, the new iPhone 4 with the stylish Retina show Steve Jobs means it has a 2-1 pixel ratio, which means that 1 pixel actually appears in the browser as 2x2 pixels, which makes it resolution (960x640 is means that this will lead to the planning of the iPad, and not to the layout of the mobile device), so this requires another multimedia request (so far only webkit is supported):
@media screen and (-webkit-min-device-pixel-ratio: 2) { ... }
So the thing is ... I want my beautiful shiny new iPhone 4 layout to be combined with the iPhone 3GS and the layout of mobile devices, because they will both have the same internal CSS code,
Therefore, I ask the question:
How to create an @media rule that points to the iPhone 4, 3GS and other mobile phones with the same styles?
css iphone css3 mobile-safari media-queries
Myles Gray Feb 17 '11 at 16:09 2011-02-17 16:09
source share