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 {

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

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

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