title: CSS Parent/Ancestor Selector
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector">Is there a CSS parent selector?</a>  </p>
  </blockquote>
  
  
  
  <p>I know this is a shot in the dark, but is there a way, using css only, CSS2, no jquery, no javascript, to select and style an element's ancestor? I've gone through the selectors but am posting this in case I missed something or there is a clever workaround.</p>
  
  <p>For example, say I have a table with classname "test" nested inside a div.  Is there some sort of:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div&gt;
      &lt;table class="test"&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>div (with child) .test
  {
       /*styling, for div, not .test ...*/
  }
  </code></pre>