title: Apply position: sticky to child of a div
body: <p>Position: sticky doesn't seem to work for me when I apply it to a child of a div. How to solve?</p>
  
  <p>HTML:</p>
  
  <pre><code>Lorem Ipsum
  &lt;div class="this-parent-div-is-necessary"&gt;
     &lt;div class="div-sticky-class"&gt;
       Test
     &lt;/div&gt;
  &lt;/div&gt;
  Lorem Ipsum
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.div-sticky-class{
    color: red;
    position: sticky;
    position: -webkit-sticky;
    top: 0;
  }
  </code></pre>
  
  <p>Example: <a href="https://jsfiddle.net/n8Le2tva/" rel="noreferrer">https://jsfiddle.net/n8Le2tva/</a></p>