CSS Parent Selector

CSS Parent Selector
As of CSS version 3, there is no parent element selector.

You can’t do something like this.

#my_big_butt:parent {
   color:#ff3333;
}

If the parent selector existed, this would return, which element?

<div>
<img src="../../my_big_butt.png" alt="My Big Fat Booty" />
</div>

You would be getting the div element. It seems stupid that the browser’s and the W3C haven’t added a parent selector, but they haven’t yet and probably won’t for many years.

Share Button