title: How to select only first three elements with CSS
body: <p>How can I select only first three <em>elements</em> with the <code>:nth-child()</code> <em>selector</em>?</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>section &gt; figure:nth-child( ? ) {
    /* ... */
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section&gt;
    &lt;figure&gt;1&lt;/figure&gt; &lt;!-- select this --&gt;
    &lt;figure&gt;2&lt;/figure&gt; &lt;!-- and this --&gt;
    &lt;figure&gt;3&lt;/figure&gt; &lt;!-- and this --&gt;
    &lt;figure&gt;4&lt;/figure&gt;
    &lt;figure&gt;5&lt;/figure&gt;
    &lt;figure&gt;6&lt;/figure&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>