title: How to get different class selectors using nth-child in css
body: <p>I have these codes  </p>
  
  <pre><code>&lt;div class="test"&gt;
      &lt;div class="tag1"&gt;&lt;/div&gt;
      &lt;div class="tag1"&gt;&lt;/div&gt;
      &lt;div class="tag1"&gt;&lt;/div&gt;
      &lt;div class="tag2"&gt;&lt;/div&gt;
      &lt;div class="tag2"&gt;&lt;/div&gt;
      &lt;div class="tag2"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now I want to get second child of <code>.tag2</code> selector.</p>
  
  <p>I try this code and it's not working, but when I use <code>.tag1</code> it's working.</p>
  
  <pre class="lang-css prettyprint-override"><code>.test .tag2:nth-child(2) {
      background-color: #000;
  }
  </code></pre>
  
  <p>How can i fix this?</p>