Update 2015 (thanks, @JayMee): The current (2015-05-29) Editor’s Draft doesn’t contain this syntax/feature anymore. (The latest Working Draft still does, but it’s from 2013-05-02.)
For the future:
In the Working Draft of Selectors Level 4 there is a way to specify the subject of a selector (resp. in the Editor’s Draft).
I guess the following should work when browsers implement it (and if the syntax will not be changed):
!div a:focus
{display:block;}
It selects a div
element (notice the !
in the selector) which has a focused a
element as child.
For JQuery, there is a polyfill (but it uses the old syntax where the !
was used as suffix, not prefix).