title: CSS position: sticky and overflow
body: <p>Not able to find the solution for this. Basically, what I am trying to achieve is to have an element with the <code>position: sticky</code> appear with a scrollbar if there is more content then the browser height.</p>
  
  <p>I don't want to use <code>position: fixed</code> as it will add additional pain in the neck.</p>
  
  <p>Here is the example of how I would expect it to work:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.placeholder {
    height: 200vh;
    width: 50%;
    float: right;
  }
  
  .child {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100%;
    overflow-y: auto;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="placeholder"&gt;&lt;/div&gt;
    &lt;div class="child"&gt;
      some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt; some long text
      &lt;br /&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/mun133e0/" rel="noreferrer">Fiddle 1</a></p>
  
  <p>Here is example with the <code>position: sticky</code> where the <code>overflow</code> doesn't do anything:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.placeholder {
    height: 200vh;
    width: 50%;
    float: right;
  }
  
  .child {
    position: sticky;
    top: 0;
    bottom: 0;
    height: 100%;
    overflow-y: auto;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="placeholder"&gt;&lt;/div&gt;
    &lt;div class="child"&gt;
      some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    some long text &lt;br /&gt;
    
    &lt;/div&gt;  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/ab5u54hh/" rel="noreferrer">Fiddle 2</a></p>
  
  <p>Any explanation / solution appreciated.</p>
  
  <p><strong>Make sure to use Firefox when testing</strong></p>