title: Div with a scrollbar, with sticky div on top and bottom
body: <p>I want to have a container with a scrollbar, with a <em>sticky</em> div on top and bottom. <strong>How to achieve that sticky div behaviour?</strong>
  i.e. with the following code, the yellow and red div should be always visible.</p>
  
  <p>(Note: The scrollbar should be full height, i.e. close to #top and #footer as well, not restricted to #main).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#top { background-color: yellow; }
  #footer { background-color: red; }
  #container { overflow-y: scroll; height: 200px; }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;
    &lt;div id="top"&gt;STICKY ON TOP1&lt;br&gt;STICKY ON TOP2&lt;/div&gt;
    &lt;div id="main"&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/div&gt;
    &lt;div id="footer"&gt;STICKY ON BOTTOM1&lt;br&gt;STICKY ON BOTTOM2&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>