title: How to get iframe width 100% in iPhone portrait view
body: <p>Basically I am having the same problem as <a href="https://stackoverflow.com/questions/13079564/appcelerator-webview-on-iphone-with-an-iframe-and-width">here</a>, but because he never got a good answer I am reposting the question.</p>
  
  <p>So the problem is that only in iPhone Safari the <code>width="100%"</code> on the portrait view seems to be misbehaving and giving the IFrame the landscape width. And I can't seem to figure out what is going on here. </p>
  
  <p>I am using the correct viewport:<br></p>
  
  <pre><code>&lt;meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" /&gt;
  </code></pre>
  
  <p>And the site within the IFrame can actually go way narrower than 320px and also has the same viewport defined. (I've read on one of the similar questions that this can be a factor so I am just clarifying).</p>
  
  <p>In the debugger I can see, that before the URL was added, the iFrame's offsetWidth was 304px which is correct and after the load it was 588px, which is correct for the landscape view. But why it changed I have no idea. The page within the IFrame comes from a different domain so that could not effect it and the main page does not do anything with the iframe's width.</p>
  
  <p>The iPhone I am using is an iPhone 5 iOS 7.0.2</p>
  
  <p>PS. Please do not post any JS answers where you resize the iframe manually on window resize, I am currently looking for a non JS fix, and this is my last option that I plan to use. Also please do no post the @media CSS answer were you set <code>min-width</code> to 320px on iPhone portrait view width, that would not work for me for various reasons.</p>