title: Apply style on immediate parent element
body: <p>Is there a way to apply style on the parent selector based on the class specified in the child. I know this can be done in Javascript but I am trying to find a solution which can be applied on my css file. I tried:</p>
  
  <pre><code>div &lt; .active {
      background:red;
  }
  </code></pre>
  
  <p>but it selects/applies style only the child. I want the style to be applicable on the div parent here for example.</p>
  
  <p>Any suggestions on this?</p>
  
  <p>Thanks in advance.</p>