title: Full height layout with Header, footer, sidebar and content divided into 4 equal boxes
body: <p>I am trying to do the layout that can be seen in the image below:
  <a href="https://i.stack.imgur.com/C6DbZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C6DbZ.png" alt="Wide screen layout" /></a></p>
  <p>It is full screen, the header and footer have <em>fixed height</em> (60px), the green sidebar is 200px wide; both the sidebar and the section on the right side occupy the <em>entire available space on the y axis</em>.</p>
  <p>For wide screens, I want to divide the right side into 4 equal boxes, displayed 2 by 2.</p>
  <p>For medium and small screens (&lt; 768px), I want to display the 4 equal boxes 1 by 4, like the image below:</p>
  <p><a href="https://i.stack.imgur.com/0Cqvy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Cqvy.png" alt="enter image description here" /></a></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html {
    height: 100%;
  }
  
  body {
    height: 100%;
    position: relative;
  }
  
  #wrapper {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    height: 100%;
    padding: 60px 0;
    position: relative;  
  }
  
  #header {
    width: 100%;
    height: 60px;
    background: #171717;
    position: absolute;
    top: 0;
    left: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }
  
  #content {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    height:100%;
    background: gray;
    display: flex;
  }
  
  #left {
    background: green;
    width: 200px;
    flex: 0 0 200px;
  }
  
  #right {
    background: red;
    width: 100%;
    position: relative;
  }
  
  #footer {
    width: 100%;
    height: 60px;
    background: #171717;
    bottom: 0;
    left: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="wrapper"&gt;
    &lt;div id="header"&gt;Header&lt;/div&gt;
    &lt;div id="content"&gt;
      &lt;div id="left"&gt;&lt;/div&gt;
      &lt;div id="right"&gt;
          &lt;div class="red_box"&gt;&lt;/div&gt;
          &lt;div class="red_box"&gt;&lt;/div&gt;
          &lt;div class="red_box"&gt;&lt;/div&gt;
          &lt;div class="red_box"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="footer"&gt;Footer&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>How do I style those red boxes to achieve the 2 layouts, if possible, <em>without using display:table</em> and display:table-cell, as this will create problems with positioning items absolutely inside the red boxes on Firefox?</p>