Possible Duplicate:
CSS :checked – change <td> background
Is there a CSS parent selector?
<ul class="submenu">
<li><a href="...">Submenu 3</a></li>
<li><a href="..." >I need to select this element</a>
<ul class="submenu">
<li><a href="...">Sub-submenu 3</a></li>
<li><a href="...">I need to select this element</a>
<ul class="submenu">
<li><a href="...">Sub-sub-sub 1</a></li>
<li><a href="...">Sub-sub-sub 2</a></li>
Basically, I need to select every <li> element that is located BEFORE ul element with class="submenu" (ul class="submenu"‘s parent)
I need to select this element
This is not possible. Your best option would be to use jQuery. That would give you many options to complete this task.
According to the link below it does look like CSS4 will have the ability to specifiy which element you would like.
Is there a CSS parent selector?