My test page is at: http://dev.my-igloo.net/ps-rwd/
I'm trying to get my head around media queries and changing the site width according to the browser width - the site has to work on iPads and iPhones and at the moment I'm testing it on the iPad and going slightly insane.
Please bear in mind the site design/layout isn't complete at the moment as I'm just working with initial settings here before I delve into perfecting everything. I've set a different background colour for each stylesheet so that it's easy to see which one is loaded.
I have this in my head tag:
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
and if I set my media queries like so:
<!-- Main Stylesheet -->
<link rel="stylesheet" type="text/css" href="ps-default.css" />
<!-- Main Stylesheet -->
<link rel="stylesheet" type="text/css" href="ps-default.css" media="screen and (min-width: 769px)" />
<!-- 768 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-768.css" media="screen and (min-width: 481px) and (max-width: 768px)" />
<!-- 480 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-480.css" media="screen and (min-width: 321px) and (max-width: 480px)" />
When I test on the iPad in landscape mode the page loads the default stylesheet but is zoomed and I have to scroll left and right to see the whole layout or pinch-zoom to zoom out to get it to fit on the screen.
How can I avoid this? I thought that by having the initial-scale set to 1.0 would make it load without zooming in.
I then changed my media queries a bit to:
<!-- For Desktop Browsers -->
<link rel="stylesheet" type="text/css" href="ps-default.css" media="screen and (min-width: 1024px)" />
<link rel="stylesheet" type="text/css" href="ps-768.css" media="screen and (min-width: 769px) and (max-width: 1024px)" />
<!-- 768 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-768.css" media="screen and (max-width: 768px) and (orientation:portrait)" />
<link rel="stylesheet" type="text/css" href="ps-480.css" media="screen and (min-width: 481px) and (max-width: 767px) and (orientation:landscape)" />
<!-- 480 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-480.css" media="screen and (max-width: 480px) and (orientation:landscape)" />
and then on the iPad in landscape mode the 768 stylesheet was loaded and the page zoomed - I don't understand what I'm doing wrong.
I're read through this: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193 and not found a solution to this problem. Other options I've tried have been to include minimum-scale and maximum-scale but this takes out the pinch-zoom functionality which is not desirable.
I've reverted back to the initial set of media queries for now and hope someone can help me.