title: CSS style for parent instead of child?
body: <p>I am using jquery to insert html I get from the server into a div. Based on the div contents i'd like to adjust the syle of the container. I wrote up a simple html test. How do I tell css to apply this site when it has X child? After googling I tried :has and :contains with neither working. I don't want to keep my styles in JS as css makes more sense. </p>
  
  <p>Demo: <a href="http://jsfiddle.net/wd9fk/" rel="nofollow">http://jsfiddle.net/wd9fk/</a></p>
  
  <p>html</p>
  
  <pre><code>&lt;div id="a"&gt;&lt;div id="b"&gt;B&lt;/div&gt;&lt;/div&gt;
  &lt;div id="a"&gt;&lt;div id="c"&gt;C&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>css</p>
  
  <pre><code>#a { height: 400px; border: 1px solid red;  }
  #b { height: 200px; }
  #a :has #b { height: 300px; border: 1px solid blue; }
  </code></pre>