title: Why is my element not sticking to the left when using position sticky in css?
body: <p>I want to fix an element to the top and left of the screen using position sticky when scrolling a large div either vertically or horizontally. Fixing to the top is working fine, but fixing to the left is not.
  This is my html page:</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>.sticky {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    top: 0;
  }
  
  .scroll-horizontally-and-vertically {
    width: 4000px;
    height: 2000px;
    background-color: lightblue;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;div class="sticky"&gt;
      &lt;h1&gt;please stick to top and left&lt;/h1&gt;
    &lt;/div&gt;
    &lt;div class="scroll-horizontally-and-vertically"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I also tried using either top or left alone, with the same result.
  I must be missing something.</p>
  
  <p>Why is the top position fixed, but not the left position?
  How should I fix the page to get the desired behaviour?</p>