title: is the ipad 3 device-width always 768 even though the resolution width is 1536 in the viewport meta tag?
body: <p>I am trying to understand the viewport meta tag for ios devices.  I created a test page, where I inserted an image that is 862px wide. so i have the viewport meta tag as:</p>
  
  <pre><code>&lt;meta name="viewport" content="width=device-width,  initial-scale=1.0, minimum-scale: .5, maximum-scale: 5.0"&gt;
  </code></pre>
  
  <p>Yet on the ipad 3, with a resolution width of 1536 pixels, and having the viewport set to the same amount of visible area of the ipad 3, the 862px image is blown up, and is a little larger in width than the visible area. so i have to scroll horizontally to see the rest of the image.</p>
  
  <p>This makes me think that device-width is returning 768 pixels, and that accounts for the little bit extra of horizontal scroll for the 862 pixel image. Why is it doing this? Is there some kind of pixel density I have to account for?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've tried setting the width to a numerical width, the same exact width of the image (in this case "862"). So the webpage is 862X206, the same as the image, yet it is doing the same exact thing as setting the width to device-width.</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I created a very simple page, and for some reason a blank page with a viewport of 862 pixels causes horizontal and vertical scrolling on my ipad 3, the code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="width=862, initial-scale=1.0"&gt;
  &lt;/head&gt;
  
  &lt;body style="width:100%; padding:0; margin:0"&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This scrolling is causing the viewport not to fit inside the viewable area or screen size. I dont understand. Any insight would be greatly appreciated. Thank you. ** Note ** I forgot to add a reset of the padding and margin to 0, it was adding 8 px of margin.</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>Ok, originally, I thought that the device-width would return the resolution width of 1536 pixels of the ipad 3.  Apparently, it returns the screen size of 768 pixels. </p>
  
  <p>Any viewport width greater than 768, gives me scrolling on the ipad 3. why? what if you had a page that was 1024 pixels, and you want to fit that into the visible area of the ipad 3. you set the width to 1024, the initial-scale to 1, shouldn't that make the 1024px viewport fit into the viewable area?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>Ok, so, if you want to have each device figure out how to scale your page, all you do is leave out the initial-scale.</p>
  
  <p>So if I set just the width, using either device-width or a numerical value, and leave out the initial-scale, it automatically calculates the zoom for you. and it just works. </p>
  
  <p>my confusion lied in what the width meant, width means the width before the scale is applied,
  so if i say:</p>
  
  <pre><code>&lt;meta name="viewport" content="width=device-width,  initial-scale=1.0, minimum-scale: .5, maximum-scale: 5.0"&gt;
  </code></pre>
  
  <p>the width of the viewport before the scale is, 768, and if the webpage body is say 862px, and after the scale factor of 1.0 is applied, the content is multiplied by 1.0, 862*1.0, so the width of the viewport <strong>is now</strong> the width of the content scaled at that scale factor, 862px. i hope i understand this right. thats where my confusion was, was what width meant.</p>