title: Switching from portrait to landscape layouts in flexbox
body: <p>I want to realize following <a href="https://i.stack.imgur.com/tOpuX.png" rel="nofollow noreferrer">Layout</a> with flexbox:</p>
  
  <p><img src="https://i.stack.imgur.com/tOpuX.png" alt="Layout"></p>
  
  <p>You can see both orientations in the picture. Left side for the portrait view and on the right side for the landscape view.</p>
  
  <p>The premise is that I want to keep my html as short as possible (if it is possible). </p>
  
  <p>Is there a way to do this with flex? </p>
  
  <p>In the portrait view everything just works fine because it's just one column. </p>
  
  <p>Now I'm stuck at the landscape orientation. </p>
  
  <p>The navigation should be on the right side of the screen and the other content on the left.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>header, footer, main, nav {
    margin: 5px;
    padding: 5px;
    border-radius: 5px;
    min-height: 120px;
    border: 1px solid #eebb55;
    background: #ffeebb;
  }
  section {
    display: flex;
    flex-direction: column;
  }
  @media only screen and (orientation: landscape) {
    /* no clue */
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section&gt;
    &lt;header&gt;header&lt;/header&gt;
    &lt;main&gt;content&lt;/main&gt;
    &lt;nav&gt;navigation&lt;/nav&gt;
    &lt;footer&gt;footer&lt;/footer&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank you very much for your time!</p>