title: First-child styling only works on first element
body: <p>I got some code where I'm selecting some elements by first child, and then styling the accordingly. I noticed that it behaves quite strangely, and the css is only being applied to the first element. I tried to select them both with JS, and it seems like, although I'm doing the exact same thing, just on another element, it doesn't return the div.</p>
  
  <p>Code:</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-js lang-js prettyprint-override"><code>console.log(document.querySelector(".index-0:first-child")); // returns div
  console.log(document.querySelector(".index-1:first-child")); // returns null</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.index-0:first-child {
    color: green;
  }
  
  .index-1:first-child {
    color: blue;
    /* doesn't work */
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="index-0"&gt;
    &lt;p class="message"&gt;&lt;/p&gt;
    &lt;div class="shout"&gt;
      &lt;span&gt;Message 1&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="index-1"&gt;
    &lt;p class="message"&gt;&lt;/p&gt;
    &lt;div class="shout"&gt;
      &lt;span&gt;Message 2&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>jsfiddle: <a href="https://jsfiddle.net/a4k03eny/1/" rel="nofollow noreferrer">https://jsfiddle.net/a4k03eny/1/</a></p>