treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Quirks when alternating between portrait & landscape

  • I'm running into a couple of quirks when alternating between portrait and landscape modes on both my Android and iPhone devices.

    iPhone quirk When opening up a webpage in portrait at

      @media only screen and (max-width: 479px) {...}
    

    and then switching to landscape at

      @media only screen and (max-width: 767px) {...}
    

    the portrait mode stays stuck! even if I refresh the page. So the result is a blurry zoomed in view of the portrait mode.

  • Do you have a link or example to show us?

  • are you using a meta viewport tag in your head?

  • Found the answer, just needed:

      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">