title: Mobile Safari - changing from horizontal to vertical view - strange behavior of body
body: <p>When testing my responsive webpage in browsers by resizing the window and using simulators, everything was fine. Now I've just tested the page on my real iPhone 4S with strange results.</p>
  
  <p>When loading the page in vertical view, everything is good, switching to horizontal view is also not a problem. 
  But when I turn the phone again so that it enters vertical view again, something strange happens. The vertical version is displayed, but it seems that the <code>body</code> does not properly resize. I get a big empty area on the right and a vertical scrollbar, while the elements on the webpage are displayed on the left. Screenshots:</p>
  
  <p><strong>Vertical #1</strong><br>
  <img src="https://i.stack.imgur.com/jXZy0.png" alt="enter image description here">  </p>
  
  <p><strong>Horizontal</strong><br>
  <img src="https://i.stack.imgur.com/0u0nA.png" alt="enter image description here">  </p>
  
  <p><strong>Vertical #2</strong><br>
  <img src="https://i.stack.imgur.com/X1Jfp.png" alt="enter image description here">  </p>
  
  <p>This is the CSS code I have on my body (Note: I am still working on that project, so the colors and the font is only temporarily written like that):</p>
  
  <pre><code>body {
      margin: 0;
      background-color: grey;
      color: black;
      font-family: Georgia, serif;
      line-height: 1.5;
      background-image: url(../img/bg.png);
  }
  </code></pre>
  
  <p>And I also use em based media queries, like:</p>
  
  <pre><code>@media only screen and (min-width: 30em) {
     /* Stuff */
  }
  </code></pre>
  
  <p>Inside the media queries I don't change anything on the body.</p>
  
  <p>In the head of my HTML file I have</p>
  
  <p><code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;</code></p>
  
  <p>Some debugging showed me, that the <code>body</code> element resizes correctly, but the <code>html</code> element does not.</p>
  
  <p>Do you have any idea what could cause that problem?</p>