No.
Why?
iPads and iPhones are different devices with different screen sizes, resolutions and different pixel densities (based on different versions / releases - see here ).
Device Screen(res) CSS pixel ratio iPad (generation 1,2) 1024 × 768 1 iPad (generation 3,4) 2048 × 1536 2 iPhone (gen 1,3G,3GS) 480 × 320 1 iPhone (gen 4,4S) 960 × 640 2 iPhone (gen 5) 1136 x 640 2
The iPad is classified as a tablet, the iPhone is mobile, and so you can never use a single multimedia query to fully satisfy both or create the perfect experience for both devices.
What can I do?
One solution is to offer a fairly general approach and provide media queries for three levels of device type and / or screen width / orientation:
- Mobile / smart phone
- Tablet
- Desktop
The underlying theory is that you need your website or application to use / view on as many devices as possible, so standardize your approach, rather than skipping many individual devices and / or manufacturers.
A rough example might be:
@media screen and (max-width:500px) { /* Mobile styles */ } @media screen and (min-width:501px) and (max-width:999px) { /* Tablet styles */ } @media screen and (min-width:1000px) { /* Desktop styles */ }
But opinions vary widely regarding the best breakpoints between the three types, and I know that research / data on such breakpoints will be widely welcomed by the development community.
What if I want to specifically target iOS devices?
Can you do this. Several people have suggested media queries that meet the specific requirements of specific iOS devices (not tested, but I often saw along with the links listed below):
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { } @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { } @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { } @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { }
Other iOS-specific efforts of others:
General link:
Caveat
I used one example above, but media queries can be applied in several ways:
@media screen and (max-width:500px) { ... } @import url(mobile.css) (max-width:500px); <link rel="stylesheet" type="text/css" media="screen and (max-width: 500px)" href="mobile.css" />